Confirm Message using Javascript

Hello, I'm having some problems to create a confirm message box that will return a value from a Hiden field.
For example:
apex.confirm('Do you realy want delete use &P80_NAME_USER.');
The name is showing but the problem is that if the P80_NAME_USER is changed the message still with the same name of the last user that was selected.
Can someone help me?
I'm using apex 4.1.
Thaks, LéoVic.
Edited by: LéoVic on Jan 14, 2013 1:43 PM

As the value of &P80_NAME_USER. in your script is replaced by the actual value on the moment of rendering the page, you should use a JavaScript function to get the current value (when it can change on the page):
apex.confirm('Do you realy want delete use '+$v('P80_NAME_USER'));

Similar Messages

  • How to use window.confirm in a JavaScript with unknown variables

    On my delete category page the user can pick the category it wishes to delete from a dropdown list (which is generated by rows in my database).
    When the user hits the "Delete" button ths OnClick runs a JavaScript that sends the delete request to a .jsp page that handles all my insert, update and delete queries.
    <input name="delete" type="button" id="delete" onClick="post('delete');return false;" value="Delete">
    function post(actValue)
         document.MyForm.action.value = actValue ;
         document.MyForm.submit() ;
    }So far, so good. But:
    Before the site goes to this last jsp page I want a pop-up window that ask's for a confirmation of the delete-request.
    So I changed the OnClick and I made another JavaScript::
    <input name="delete" type="button" id="delete" onClick="delete('categoryName');return false;" value="Delete">
    function deleteConfirm(categoryName)
         if( window.confirm("Are you sure you want to delete: " + categorieNaam + "?") == true)
              post('delete');
              return false;
    }The problem is, when the page is loaded, we don't know yet what category the user wants to have deleted. So categoryName is unknown.
    How can I make this work?

    You have the category in a dropdown list?
    <select name="catToDelete">
    <option value="cat1">cat1</option>
    <option value="cat2">cat2</option>
    <option value="cat3">cat3</option>
    </select>
    You can use javascript attributes such as
    var toDelete = document.all.catToDelete;
    // the value it will submit
    var selectedValue = toDelete.value;
    // the selected index
    var selectedIndex = toDelete.selectedIndex;
    // the option that is selected
    var selectedOption = toDelete.options[selectedIndex];
    // the text of that option
    var theText = selectedOption.textYou should be able to extract the info you need from that I hope.
    Cheers,
    evnafets

  • Button not disabling using Java Script after confirm message in button

    I have a STAGEDATA button on a form with the following code to prevent Resubmissions (Apex 4.0)
    Action When Button Clicked:
    Action: Redirect to URL
    Execute Validations: Yes
    URL Target:
    javascript:if ( apex.confirm('Have you saved the data on the current page? Please confirm.','STAGEDATA') ) {javascript:this.disabled=true;this.value='Staging data...';apex.submit('STAGEDATA');}
    When I click the button, the confirmation message is displayed.
    However, after the confirmation message is displayed, the button is not disabled and the value does not show, while post processing of the page takes place before moving to the next page.
    Am I missing something?
    Appreciate your help. Thanks in advance

    Hi,
    try adding
    <script>
       alert('Testing');
    </script>
    This actually adds the script to the page body and not the header as af:resources does
    Frank

  • Using JavaScript need to clear speach bubble error messages

    Hi,
    I used AdfPage.PAGE.clearMessages(null); in javascript to clear the error message, But it will not clearing the error message(speach bubble error message), it will clearing only when ADF popup Error Messages.
    Example:
    I entered wrong date in the DateField, it shows speach bubble error message "Wrong Date Format -- Enter correct format".
    Using accessKey, I am resetting (Ctrl + t) the page. It is not resetting the page.
    If the error message is in popup, then it clearing the error message as well as resetting.
    Can anyone helpme to provide solution to clear the speach bubble error message in javascript.
    Thanks in Advance

    Hi,
    Can you explain me how to clear using field focus listener instead of a key combination for inputDate combnation.
    Thanks

  • Problem with confirm() function in javascript

    Hi All,
    When we use confirm() function in javascript, it displays message with two options Ok or Cancel.
    Is it possible to change the Ok, Cancel buttons as Yes,No or Accept,Reject.
    Is there any other way to implement it.
    Thanks in advance,
    Maha

    Hi,
    We don't have any provision to have Yes,No or Accept,reject button in javascript confirm() function. You can preprare your own popup window and acheive the same thing.
    Regards,
    Sudheer

  • Confirmation Message in CC&B

    Hi,
    I need to create a "Confirmation Message" in a User Exit to perform some validation and a user decides to continue or not with the actions.
    Anyone know if this is possible and how to do it?

    Can be done but you have to use VBScript instead of JavaScript:
    http://www.webreference.com/dhtml/column22/js-vbMsgBox.html

  • How to display a confirmation message before deletion

    Hi,
    I have an application and I want to display a confirmation message before people delete a record.
    The button on page 42 is number 90     "Supprimer cette fiche". It is a Submit as "DELETE_ALL". I have seen that the delete buttons are redirections to the url javascript:confirmDelete(htmldb_delete_message,'DELETE');, but I cannot use this as my button is not a redirection, but a submit.
    http://apex.oracle.com/pls/otn/f?p=4550
    Workaspace : ESPACE2008
    User : guest
    password : acdc2009
    Name of application is Activites
    Thank you for your kind answers.
    Christian

    Hi Christian.
    You can use the same logic for your own processing logic.
    the syntax is...
    javascript:confirmDelete(htmldb_delete_message,'YOUR_PROCESS_NAME');Replace 'YOUR_PROCESS_NAME' with the name of your page process that handles the bulk delete. Don't for get the single-quotes either side of your process name.
    Hope this helps.
    Simon

  • Confirmation message in Java Script

    By default , focus will be on OK button in confirmation message box. Is it possible to get the initial foucs on Cancel button
    Thanx

    Can be done but you have to use VBScript instead of JavaScript:
    http://www.webreference.com/dhtml/column22/js-vbMsgBox.html

  • I am having problems using javascript:confirmDelete

    I have two pages created by the wizard, a report with a form. As you all know you view a list of records on the report then click the “Edit” button and it calls the form to edit the individual row. I have made a change to the action of these two pages. When you are on the report page and click “Create” you are moved to a blank form page. Once you have entered your new record you click “Create” and the row is saved. By default you are then moved back to the report page. The same this happens when you “Apply Changes” or “Delete”. My problem is that I have altered this behavior to return you back to the form and the record you just created or edited. This was done by editing the “Go to Page” branch created by the wizard to go to the form page rather then the report page. I also set the “Return Key into Item” in the “Automatic Row Processing (DML)” process to the page item containing the primary key value. This all works as I would like it to except for “Delete” it tries to come back to the form page and gives a “No Data Found” error. I would like it to just return to a blank form page or even go back to the report page. I do not know how to change or intercept the page the “Delete” button sends you to when it is set to use the URL javascript:confirmDelete.
    I am using: Application Express 2.2.1.00.04

    Chris - You need to create a branch on the page that goes back to the report page when button pressed is DELETE (Delete). Give this branch a lower sequence number than unconditional branches on that page. If you look at the HTML source of your form page you'll see < a href="javascript:confirmDelete(htmldb_delete_message,'DELETE');">Delete< /a> for the delete confirmation message confirmation action. If you check the javascript function confirmDelete, I think you'll see that it submits the page using the second argument ('DELETE' in your case) as the request.
    Scott

  • Writting confirmation message??

    Hi all friends,
    I am developing one uploading software it is a total automatic process of uploading user only copy the files in predefind folder and click on upload button once and my software starts uploading one by one from queue and move the file one by one into another folder automatically after completion of uploading.After that in between uploading if user copy more files in that folder my software automatically takes those file for uploading not require to click on upload button again.Now I am facing problem on writing confirmation message of uploading of every file on my swing interface which my servlet writing on PrintStream after completion of writing of every file on destination.But my interafce not writing those confirmation messages on textArea but it is writing confirmation message of last file on Dos-Prompt coz iam running my application from Dos-prompt.I want to write every file's uploading confirmation message on textArea of my swing application.Can any one plz guide me how I can do that.Below r my codes:-
    swing application(Iam pasting those portion only):-
    ===================
    class Loglater implements Runnable {
    String msg;
    public Loglater(String s) { msg = s; };
    public void run() { log(msg); }
    public void log(String msg) {
    if (SwingUtilities.isEventDispatchThread()) {
    textArea.append(msg);
    textArea.append("\n");
    System.err.println(msg);
    else {
    SwingUtilities.invokeLater(new Loglater(msg));
    return;
    servlet:-
    ========
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class RecvFileServlet extends HttpServlet {
    String s,str,str1,filename,path;
    public void init() throws ServletException {
    super.init();
    baseFile = new File(BASE_DIR);
    str="false";
    str1="false";
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.sendError(response.SC_NOT_ACCEPTABLE, "Must use POST method.");
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, IOException
    PrintStream pos = new PrintStream(response.getOutputStream());
    response.setContentType("text/plain");
    filename = request.getParameter("name");
    path = request.getParameter("path");
    File outfile = new File(filename);
    System.out.println("path value = " + ((path == null)?("null"):(path)));
    System.out.println("name value = " + ((filename == null)?("null"):(filename)));
    if (path != null && filename != null) {
    outfile = new File(path, filename);
    System.err.println("Final output file: " +
    outfile.getAbsolutePath());
    // create a DataInputStream to read from sender
    DataInputStream dis;
    dis = new DataInputStream(request.getInputStream());
    OutputStream os;
    // create file output stream to write the output file
    System.err.println("Using output file " + outfile);
    os = new BufferedOutputStream(new FileOutputStream(outfile));
    int cc;
    byte [] buf = new byte[1024];
    long tot = 0;
    // read from the input stream and write to the file
    try {
    for(cc = dis.read(buf, 0, 1024);cc > 0 ; cc = dis.read(buf, 0, 1024))
    os.write(buf, 0, cc);
    tot += cc;
    System.err.print("+" + cc + "(" + tot + ")");
    catch (IOException ie) {
    try { os.close(); } catch (Exception e2) { }
    pos.println("Problem : " + ie.getMessage());
    // done reading and writing, close the file output stream
    System.err.println("Write" + tot + " bytes.");
    os.close();
    // Send back a response message to the application
    pos.println("File" +" "+ filename+" "+"Upload Completed !");
    Regards
    Bikash

    OK, he must have just put that limit in because of some reports of looping, although when I tested it, it seemed to work.
    If you are happy with running javascripts, there is a java script to do the same thing in the Apple iTunes COM SDK which you can download from here:
    http://developer.apple.com/sdk/itunescomsdk.html
    I wouldn't bother unless you have some knowledge of how to run scripts from the cmd Window.
    EDIT added later, sorry I am going mad here, I was talking about another script. What you need to do is to delete your iTunes preference files which resets iTunes to the state it was in when you first installed it.
    May need to make hidden files visible
    My Documents>Tools>Folder Options>View
    Check Show hidden files and folders
    -- Quit iTunes
    -- Delete C:\Documents and Settings\<your username>\Application Data\Apple Computer\iTunes\iTunes.pref and/or iTunesPrefs.xml
    -- Delete C:\Documents and Settings\<your username>\Local Settings\Application Data\Apple Computer Inc\iTunes.pref and/or iTunesPrefs.xml
    For Vista the files are in:
    C:\Users\username\AppData\Local\Apple Computer\iTunes
    C:\Users\username\AppData\Roaming\Apple Computer\iTunes

  • Identify OK or cancel is clicked by user in Delete Confirmation message

    Hello,
    I am using oracle APEX 3.2 ;
    Can anyone please help me out with this issue. I want to identify whether OK or cancel button is clicked for the delete confirmation message when the delete button is clicked by the user. I am using the javascript
    confirmDelete(htmldb_delete_message,'DELETE'); message for deleting a record. I have an alert message popped out after delete confirmation appears. Below is the javascript function which does alerts the user.
    function deleteProcess()
    alert('Successfully deleted the record. Please click OK to close popup window and \n refresh the parent window.');
    window.close();//close the popup window
    window.opener.doSubmit('REFRESH');
    //call doSubmit function on the parent window to cause the page to refresh.
    For the delete button; I have set the target: URL and
    URL target: javascript:confirmDelete(htmldb_delete_message,'DELETE');deleteProcess();
    By my problem is deleteProcess() function is executing even if I click cancel button on the delete confirmation message.
    So, can anyone please help me like how to make the function deleteProcess() conditional ; I mean alert message should be popped out only when user clicks OK on the delete confirmation message.
    Thanks,
    Orton

    Hi Orton,
    Unfortunately confirmDelete() returns no value to test on (shame - that value can be very useful). As a work-around, replace your URL target with this:
    javascript:if (confirm(htmldb_delete_message)) {doSubmit('DELETE'); deleteProcess();}Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Can click on "confirm" message popup only at second click

    Hi,
    I'm trying to figure out how to handle this issue:
    We have a complicated GUI in our website and one of the actions the user wish to perform - should show him a Confirm message box (using javascript: confirm()).
    The problem is that if he tries to click on the Confirm Box (no matter where in the box) - it bubbles the mouse event to the GUI. the Confirm Box responds to the mouse event only on second click.
    Do anyone knows how can I prevent the Confirm Box to bubble the event?
    Thanks.
    P.S.
    Sorry for my broken English.. Hope my question is clear enough.
    Message was edited by: Nir_Alshek

    Unfortunately that didn't work.  I went to Start->Programs->National Instruments->TestStand 3.5->Operator Interfaces->LabWindows-CVI and got the following error message:
    Test Executive
    Error in call to LoadPanelEx
       Parent Panel Handle: 0
       UIR File Name: TestExec.uir
       Panel Resource ID: 4
       Hinstance: 0x00400000, D:\...\OperatorInterfaces\NI\Full-Featured\CVI\TestExec.exe
    Error Code: -143
    Active X control error
    The actual error window is attached.  Looks like my installation has other problems?  With the way our IT department operates, if there is a way to fix this without reinstalling, that would really be helpful... :-)
    Attachments:
    err4.JPG ‏20 KB

  • How to retrieve value of one column to other in Apex using Javascript

    Hi all,
    Can any one help me in solving this problem.
    How to send a value from one column to another column using javascript in Apex. I heard that we can use onChange().
    My requirement is,
    I have a column(Varchar2) in form where i need to enter a value and the data need to be sent to another column(Number) when i press apply changes.
    ex: if i enter a value say 1/3 or 1/4 or 1/3*1/6
    the result should be entered in the other column.
    Message was edited by:
    Raman

    Try something like
    html_GetElement('P1_ITEM2').value = eval(html_GetElement('P1_ITEM1').value);

  • Issue with page processing - confirmation message & show /hide a button..

    Hello,
    I am working on a to do list application.
    I have events and for each event, I show list of tasks (grouped in reports based on the calculated task's status).
    In one region I have a drop down list of events and a Select Event button.
    For each task, I had to create a CLOSE option (initially I used a link, but the requester wanted a confirmation before closing the task).
    Now I have a checkbox for each task (generated dynamically with apex_item.checkbox(1,task_id)).
    Closing a task in my application means to set the end_date to sysdate.
    I followed the instructions from
    http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/check_box.htm#CEGEFFBD. I've created also a button and a process and updated the sql from "delete" to "update".
    The process is set: OnSubmit - After Computations and Validations; Run Process Once per page visit (default).
    The issue number 1 is that I see the confirmation message (that tasks have been closed) every time I reload the page (the same when I click Select_event button).. not only after I press on that Close_task button..
    For issue number 2, I have to mention that I've added a condition to show / hide the Close_task button, only if I have at least 1 task in the report.
    The issue number 2 is that I see the button only if I click 2 times on the Select_Event button.. The same is for hide.
    I feel like I am missing something very important about how to synchronize different events(buttons clicks), processes..
    help..?
    Thank you!
    Anca

    This forum is magic..
    As soon as write here, I find the answer!
    Issue 1: I fixed it by specifying this: When Button Pressed (Process After Submit When this Button is Pressed) and my button. I miseed this 1st time.
    Issue 2: I moved the button after the report.. and now it's working just fine!
    I did this about it for some time before asking the question here.. but I just had to write here and got the right answer ;)
    Have a nice day!
    Anca

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

Maybe you are looking for

  • Output having problem in PO

    Hi, Don't know whether you come across this problem but I hope you can shed some light as to why my PO documents are unable to trigger and to retrieve the output condition despite that I have enter the condition record in MN04? I checked NAST table,

  • How I can include js (javascript) file in a jsp page?

    Hi, I�ve tried to include a js (javascript) file in jsp file but it doesn�t work. When I try to use a js function in the browser I always receive an error. Oh, of course, I�m including the correct tag <script src= ... What can I do? Does the problem

  • Copying ipod music into my itunes library

    I recently lost everything on my computer and had to get a new one. I reloaded my ipod information and would like to edit the music that I currently have in my ipod. How do I do this? Do I need to copy it to my new computer's itunes library? If so, p

  • Client_host ftp

    gretings gurus i'll try to explain my problem. SITUATION 1: send a local file to server 'CMD /C START ftp -v -n -s:"c:\temp\in_out_ftp.txt" ' in_out_ftp.txt: open sv_ip user user1 pass1 ASCII lcd c:\temp cd server dir put file bye now this works fine

  • Crystal Reports 2008 Loading Failed Error in Windows 7

    Hi, We are using Crystal Reports 2008 in our application. These are working fine in XP Professional OS. But the Same code is not working in Windows 7 operating system. When I debug, I found report Load is failing. Error is at below line of code. CR.L