JavaScript Confirm Pop Up

I am calling a JavaScript function from a dropdownlistbox onClientSelect attribute. The javascript function dispalys a confirmation pop up with OK and CANCEL buttons. When the user hits OK, the JS function issues htmlbevent.cancelSubmit = false and I continue with serverside processing. However, when the user hits CANCEL, I still need to continue with serverside processing and change the dropdownlist box value back to previous value. Is there a way that I can capture users response from the confirmation pop up in javascript and return it for serverside processing. Thanks.

on both user action OK or CANCLE you want server action but you want to differentiate whether the user clicked ok or cancle (to carry out different server action)
to achive this have a hidden form field. and set the value to OK or cancel based on waht user selected in confirm dialog .
the js code would look somethig like below.
var Check = false; Check = confirm('k1?');if(Check == false){ document.myform.hiddenformfield.value="false";htmlbevent.cancelSubmit = true; }
now you can read the hidden form field in oninputprocessing and based on the value you can do further processing.
Regards
Raja

Similar Messages

  • Confirmation pop-ups - only via javascript?

    I want to have a confirmation box pop-up when I have changed a field in a form and pressed the submit button.
    Looking through this forum, all I've found is confirming deletions with javascript via a URL target:
    javascript:confirmDelete('Are you sure you want to change the password?');
    This gives me a deletion error:
    ORA-20001: Invalid action DELETE on this object. (U)
    Error Unable to process row of table USERS.
    OK
    presumably because I'm not deleting anything - I just want to confirm my change.
    Do we always need to use javascript for confirmation pop-ups?
    If not, how else can we achieve this?
    How do we make the pop-up dependent upon at least one field value being changed?
    How do I get the pop-up to ask for a Yes/No response instead of Cancel/Yes options?
    Any help on this would be greatly appreciated.

    "Looking through this forum, all I've found is confirming deletions with javascript via a URL target:
    javascript:confirmDelete('Are you sure you want to change the password?');
    This gives me a deletion error... presumably because I'm not deleting anything - I just want to confirm my change."
    The definition of the javascript function is: function confirmDelete(msg,req). It takes an optional second parameter called req. This specifies the REQUEST value that should be set when the user clicks OK on the confirm pop-up. If you omit this second parameter in your call to the javascript function a request value of 'Delete' is set. This is why you are receiving your error. You should set the second parameter to be some custom REQUEST value.
    "Do we always need to use javascript for confirmation pop-ups?"
    For popups of this sort the answer, in short, is "yes". There are no other client-side languages that work cross-browser like javascript. You could avoid javascript (and popups) altogether if you wanted by just having an intermediary Apex page with buttons representing whatever actions you want the user to be able to perform, e.g. "Yes", "No" and "Cancel".
    "How do I get the pop-up to ask for a Yes/No response instead of Cancel/Yes options?"
    See this thread for a discussion on this topic: Re: Javascript Yes & No buttons
    Andy

  • Problem with javascript confirm() in a JSP

    I'm trying to use a confirm() box in a jsp. I've looked at tons of examples and I still have the same problem. If I just add this to my page the prompt will pop up as expected: (of course it doesn't really do anything.)<SCRIPT LANGUAGE="JavaScript">
    confirm( "Are you sure you want to delete?" )
    </SCRIPT>As soon as I add an if clause around it it doesn't even pop up anymore, such as:if (confirm("Are you sure you want to delete?")){
    <%
         Do some jsp stuff
    %>
    else {
    <%
         Do some jsp stuff
    %>
    }I can include more of the code if needed. This code is for deleting some files, so I want to add an "are you sure prompt?". If they hit ok it will delete, otherwise cancel the operation.
    I assume that the "if confirm( "Are you sure you want to delete?" ) " should wait for a reponse before continuing. Any help is appreciated.
    Thanks,
    James

    You can use Javascript to confirm a delete, and delete an object in the following manner.
    //link to delete an object..
    <a href="thisPage.jsp?delete=<%= itemID %>"
       onClick="return confirm('Are you sure you wish to delete this item?');">delete</a>Then, at the top of the JSP pageif(request.getParameter("delete") != null)
       //do whatever to delete, then load the page as normal
    }Now, your item will be deleted, and the page will be refreshed to show the changes.

  • Confirm pop up values

    Hi,
    I have a Confirm javascript in my html.
    In the form I have a salary text whene enetred and hit tab the confirm pop comes with £0.00 values rather the salary entered values.
    This works find in IE

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
    The helpers at that forum are more knowledgeable about web development issues.<br />
    You need to register at the mozillaZine forum site in order to post at that forum.<br />
    <br />
    See http://forums.mozillazine.org/viewforum.php?f=25
    You need to post a link to the website or post relevant parts of the code.

  • Javascript  Confirm Based on server time!!

    Hello Everybody,
    I want to raise a javascript confirm dialog box based on the server time. On button click, I want to raise the following code if the time is between 11 am to 24pm.
    E.g.
    IF l_time BETWEEN '11:00' AND '24:00' THEN
    htp.p('<script>');
    htp.p('var r=confir("Do you want to proceed?");
    htp.p('........so on');
    htp.p('</script>');
    ELSE
    -- just submit the page
    END IF;
    Any help will be appreciated!!
    Thanks,
    Parveen

    Hi,
    a.Always mention the Apex version, in every post.
    b. Always enclose your code in a pair of tags to make is more readable.
    Javascript can read the local machine time. If you want to access the server time you will need to use PL/SQL or SQL for that and pass that to the javascript function.
    Any specific reason why you are generating the JS through PL/SQL? Its so much easier to decalre the function in the Page HTML Header rather than doing htp.p.
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to Add A Javascript Confirm() on an Apex button for a form?

    Hi, how can I add a Javascript confirm() to a button in Apex for a form? Thanks.

    Hello:
    You could do the following
    1)In the 'Option URL Redirect' section of the Edit Button page set 'Target is a ' to 'URL'
    2)For URL Target enter javascript:{if (confirm('Your Question here')) doSubmit('<button name>');}Varad
    Edited by: varad acharya on Jul 15, 2009 3:47 PM

  • Need a confirmation pop up in a procedure...Is it possible...please help

    We are calling a procedure in Java servlet through oracle apps..We need a confirmation pop up in that procedure present in java servlet..Is this possible ???
    for an Understanding:
    Apps ==> Java Servlet ==> Oracle Procedure.
    in Oracle procedure is it possible to put confirmation box?
    Will appreciate your help.
    Thanks in advance...

    Thank you!
    Actually I Tried to display an alert box through Htp.p('<script>alert("hi");</script>');
    but it's thoruh-up error. As i am calling Servlet from oracle Apps. I tried through this way. Now I understand this is not possible. I will go some other way to do this.

  • How to create confirmation pop in process classes

    Hello experts,
             I have a requirement to create a Confirmation pop up in a Zprocess -> Z process class-> method. This method is triggering when user selects contract line item and press on change contract button than selects any one process from drop down list and press on the start process in the contract management screen.
    Thanks in advance.
    Thanks,
    Nagaraj

    Hi,
    here an example where we create a confirm popup before a contactperson could be deleted:
    * prepare popup and instantiate it
          DATA: lv_title type STRING,
                lv_text type STRING.
          if CONFIRM_POPUP is not bound.
            lv_title = 'Popup'(001).
            lv_text = 'Ansprechpartner löschen?'(002).
            call method comp_controller->window_manager->create_popup_2_confirm
              EXPORTING
                iv_title          = lv_title
                iv_text           = lv_text
                iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_yesno
              RECEIVING
                rv_result         = CONFIRM_POPUP.
            CONFIRM_POPUP->SET_ON_CLOSE_EVENT( iv_event_name = 'CONFIRM_POPUP_CLOSED' iv_view = me ).
          endif.
          CONFIRM_POPUP->OPEN( ).
    Kind regards
    Manfred

  • Displaying a servlet string in a confirm pop-up

    Hello,
    Can someone please let me know if and how I can take a servlet string variable and place it into a confirm pop-up window?
    Thanks,
    - Grant

    <%
        String str = (String)request.getAttribute("string.to.display");
    %><html>
    <head>
    function doConfirm() {
    confirm("<%=str%>");
    </head>
    <body onLoad="doConfirm()">
    This was a test. This was only a test.
    </body>
    </html>
    I hope that helps!

  • Javascript Confirm box dependent on results of query

    Hi
    I'm using Apex version 3.2.1 and I'm looking for a way to do the following, any help much appreciated:
    A javascript confirm box will appear when the user submits a page if the result of a query returns anything, the query would look something like this....
    SELECT * FROM LINKEDPROJECTS
    WHERE ENV_ID = :P18_ENV_ID
    AND COMP_ID = :P18_COMP_ID
    AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')
    AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')
    If it doesnt return any data the page will submit as normal, if it does return any data the confirm box will appear, and the message will also be driven by the result of a query.
    So the message would be something like....
    Project(s) +"Select NAME FROM PROJECTS WHERE ID IN (SELECT PROJ_ID FROM LINKEDPROJECTS WHERE ENV_ID = :P18_ENV_ID+
    +AND COMP_ID = :P18_COMP_ID+
    +AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')+
    +AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')"+ have this environment booked on the dates you selected.  Do you want to continue with the booking?
    Selecting yes submits the page, selecting no returns them to the page.

    In a nutshell (and some pseudo code):
    The button URL would look something like "javascript:beforeSubmit()" without quotes and where beforeSubmit is the name of your function.
    The function would look something like:
    function beforeSubmit() {
      var runQuery = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=RunTheQuery',1);
      var result = runQuery.get();
      if (result = 0) {
        if (!apex.confirm('Submit page?")
          return;
      doSubmit('SUBMIT');
    {code}
    The application process, called "RunTheQuery" in this example, is a PL/SQL block that runs the query and return the value using the htp.prn function.
    There are probably errors in the above as I just did this off the top of my head, and you will probably need to tweak it somewhat.  But hopefully you get the idea.
    Mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript Confirm Redirect

    I am looking to figure out how to do a javascript confirm
    Redirect popup. Can anyone help me out with that? Is there a
    Dreamweaver behavior for that?

    I'm not sure exactly what you mean, but it's easy enough to
    make a popup (to
    open a second sized browser window) by using DW's Open
    Browser Window
    behavior.
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    "joey_a" <[email protected]> wrote in
    message
    news:edbo7j$iea$[email protected]..
    >I am looking to figure out how to do a javascript confirm
    Redirect popup.
    >Can anyone help me out with that? Is there a Dreamweaver
    behavior for that?

  • Javascript confirm alert Can we change the text ok

    can we change the ok and cancel text in the javascript confirm alert. pls respond, its very ungent
    Edited by: Bini John on Jun 10, 2009 9:19 AM

    Hi,
    Yes if client want new description for the PS Group, you have to create new only and assign the wage types to them and so on..... you have to do all the configurations regarding the PS Group. Here the main point is be careful with the start date of the PS Group for newly created records and assignments.
    Best Regards.

  • Confirmation Pop up while creating External shopping cart

    Hi guys,
    Please help me...
    Am working on the requirement where i need to bring the confirmation pop up window when  external shopping cart is upload and before the  shopping is being created.
    Thanks,
    Vignesh

    Hi jason,
    The requirement describes,
    When we upload file to Create external shopping cart,SRM creates the Shopping cart without asking for any confirmation from the user and my requirement is to create the confirmation screen before the shopping cart is created .
    Thanks,
    Vignesh.

  • Everytime I go to another page a confirm pop up appears and asks if I want to change locations. It get annoying after a while. How can I get rid of it?

    when I go to another page, a confirm pop up appears and asks if I want to change locations yes or cancel. Every time...it gets annoying and would like to delete it or disable it.

    I am having the same problem and when I am on Face book, it gets really annoying because you switch pages so many times, especially when playing games.

  • How to reduce the size of the confirmation pop up window?

    Hello All.
    In my application I have used confirmation pop up, for updating the users about the actions they have performed.
    But the size of the pop up window is too big.
    I want to reduce the size of the pop up window.
    How can I achieve this?
    Regards,
    SampathKumar.

    >
    Thomas Jung wrote:
    > The popup automatically resizes to its inner content. If you are reusing one of the standard SAP-Provided confirmation popups, then you really can't control the size.
    Hi Thomas!
    Yes, it is true, but in our HR system after an SP upgrade it dosn't works.
    Look at my thread, you can see an image 'BEFORE and AFTER' !
    [Popup size error in Webdynpro for ABAP|Popup size error in Webdynpro for ABAP]
    Thanks.

Maybe you are looking for

  • AppleTV HomeSharing Movie Sound Keeps Dropping

    Starting about a month or so ago, movie files which stream from my Mac to my AppleTV keep dropping sound periodically (every 2-3 minutes, sometimes as short as 10 seconds).  I can pause the movie and then press play and the sound comes back - althoug

  • Can a user have more than one RBS value?

    In our current environment, we have our RBS structure setup similar to our University organizational chart. Many of these groups collaborate with each other on projects and this structure does not allow for one user to see projects from multiple depa

  • Correlation set was not defined in the process

    Hi All, I deplyoed a synchronous CustomerProviderABCS on SAO 11g server. This process is invoking the Adapter service(mediator) which internally calls the SAP Adapter. I didn't define any correaltion sets and I am not using pick activity. After deplo

  • "Low Battery" notification app

    Can anyone point me to a simple app for low battery warning that will sound an alert every few minutes? There are a couple, but one has a very quiet alert that can't be changed and the other one doesn't get good reviews. There are such features in th

  • Can BC4J be used with Hypersonic SQL?

    Has anyone been sucessful using BC4J applications with Hypersonic SQL? If so, which versions of each. Thanks in anticition, Paul Bandler