Confirm Dialog (JavaScript)

Hi,
I'm using the JavaScript confirm dialog attached to a button (return confirm('xxxxxxxxxxxxxxx').
It works fine but I need two things:
1. How can I change the window title?
2. How can I change the titles of the two buttons? (I need them in Spanish).
Thanks a lot for your help

Hi!
As far as I know, there is no possibility to change title of standard dialogs like alert, confirm etc. You can use window JavaScript object and set title in it's parameter name.
And since JavaScript is realized in browser, it seems that change of your locale should change button's title to language of locale.
Thanks,
Roman.

Similar Messages

  • Confirmation Dialog when clicking on Tree Node.

    I am working on Oracle Apex 4.2.0.00.27 and I have the following problem:
    The code below shows the definition of a tree. The tree displays records from the table ACTIVITIES in hierarchical structure.
    When user clicks on a leaf/node of the tree he will be redirected to another page where the details of each Activity/leaf/node are displayed.
    The tree is part of a page where I have established a functionality to check for changes on the input fields of the page and inform the user when he tries to redirect without first saving the changes he made.
    What I want to do is:
    WHEN user clicks on a node of the tree AND he hasn't saved any changes he made
    THEN
    trigger a confirmation dialog.
    IF
    he clicks OK he is redirected to the node details page as defined on the tree definition:
    f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID"
    ELSE if he clicks CANCEL
    he stays on the same page.
    The condition to trigger the confirmation box is:
    if (document.getElementById('P0_CHANGES_DETECTED').value == 1)
    where P0_CHANGES_DETECTED is a universal hidden text field that is set to +'1'+ every time a change is made.
    and here is the tree definition:
    select case when connect_by_isleaf = 1 then 0
    when level = 1             then 1
    else                           -1
    end as status,
    level,
    +"NAME" as title,+
    null as icon,
    +"ID" as value,+
    null as tooltip,
    decode(PARENT_ID,null,null, 'f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID") as link
    from "#OWNER#"."ACTIVITIES"
    where GROUP_ID = :P20_GROUP_ID
    start with "ID" in (select ID from "#OWNER#"."ACTIVITIES" where GROUP_ID = :P20_GROUP_ID and PARENT_ID is null)
    connect by prior "ID" = "PARENT_ID"
    order siblings by "ID"
    I hope it is clear what I want to achieve. Thanks in advance.

    So you'll want to bind an event to all tree nodes that checks for the value and then fires the confirmation if there value is 1.
    Try something like this:
    - first, give your static ID attribute in your tree the value of tree_static_id (or whatever you want. just replace the id selector below with what you choose).
    - In your Page Function and Variable Declaration Javascript:
    function confirmSave() {
    var changeDetected = jQuery('#P0_CHANGES_DETECTED').val();
    if(changeDetected == 1) {
    //only do this if change is detected
    if(confirm('You have unsaved changes. Do you want to leave this page?')) {
    window.location('[your url here]');
    jQuery(document).ready(function() {
    //bind function to the click event
    $('#tree_static_id').find('li a').bind('click', function() { confirmSave(); } });
    });Hope this helps

  • Display confirmation dialog when opening PDF

    I've been asked to add a confirmation dialog box to a PDF file that includes a legal disclaimer. The dialogue box would display when opening the pdf document and include yes and no buttons to confirm that the user understands and accepts the disclaimer before reading the document. Selecting "Yes" would allow them to proceed, while selecting "No" would close the file. Is it possible to create something like this in Acrobat? I'm running Acrobat Standard 8.
    Thanks,
    Eric

    Hi Eric,
    Yes, you can do that but it's not an easy task.  You need to code the dialog in JavaScript and then use OCGs (layers) for a cover sheet that will remain "on" until the user selects the Yes button in the dialog.  Coding the dialog is a major task to do by hand and I'm not sure if Acrobat 8 Standard has the OCG capability.
    Check out our tool AcroDialogs(http://www.windjack.com/products/acrodialogs.html) for making dialog creation about 100 times faster and easier, and there is an example of a license dialog agreement just like what you are asking for on that page- scroll down to the Document License Dialog Example. But again, that solution was developed with Acrobat Professional and I'm not sure if Standard handles OCGs or not- you'll have to check on that.
    Also keep in mind this is by no means a foolproof security methodology.  However, it does provide a way to ensure the user agreed to the dialog before viewing the rest of the content.
    Hope this helps,
    Dimitri
    WindJack Solutions
    www.windjack.com
    www.pdfscripting.com

  • Poping Up a Confirmation Dialog

    I would like to popup a confirmation dialog when a user clicks a 'cancel' button in my page. If the user clicks 'NO' in the dialog, data is not cleared and navigation is canceled.
    I tried this ...
    public String cancelBtn_action() {
            int i = JOptionPane.showConfirmDialog
                        (null, "Do you really want to clear all data and start over?",
                            "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(i == JOptionPane.YES_OPTION) {
                getSessionBean1().clearBeans();
                return "clear";
            else return "null";
        }... but the dialog is hidden behind all the open windows on my machine (b/c the 'null' argument in showConfrimDialog, I guess).
    Can I attach this dialog to the page somehow (so it does not get hidden)? Should I even use Swing? Is there a prefered way to use popup dialogs in JSF/Creator?
    Any information would be much appreciated.

    Thank you for your reply.
    Pardon any redundancy, but to be sure that I am making myself clear and that I am understanding your response...
    At first 'cancel_action()' ( event handler in the page bean) looked like this:
    public String cancelBtn_action() {
           getSessionBean1().clearBeans();
           return "cancel";
    }To make this code conditional I next tried this:
    public String cancelBtn_action() {
            int i = JOptionPane.showConfirmDialog
                        (null, "Do you really want to clear all data and start over?",
                            "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(i == JOptionPane.YES_OPTION) {
                getSessionBean1().clearBeans();
                return "cancel";
            else return "null";
    }This code works 'fine', except that the dialog gets displayed behind all open windows where the user can not see it. (If there is a way to tie the dialog to the browser frame so it does not get buried (maybe there is?), this would allow all the JOptionPane stuff to be leveraged nicely with JSF).
    Since you are not modifying any data based on the
    response received from confirmation dailogclearBeans() clears data previously entered in several session-scoped beans (so data is (conditionaly) modifed). "cancel" and "null" are different navigation cases
    I would suggest to use javascript based dialogs. I like the simplicity of using javascript, but I need to set a flag (or something similar) in my page bean to conditionaly control navigation and whether to clear data stored in the session beans. This seems to require that the javascript calls a method in the page bean. Can this be done with JSF?
    >
    You can also use another jsp page in a popup as
    confirmation dialog by specifying the size of the new
    page.
    So I guess you mean a non-JSF JSP page? Since I need to finish executing the code in the event handler that was interupted by the confirmation dialog, I think that JSF navigation/lifecycle issues would be a problem. Am I correct?
    Again pardon any redundancy.
    More details on either (or any other) approach would be helpful.

  • Submiting JSF form on clicking ok of Confirm dialog box

    Hi,
    We are using JSF 1.2 and Seam 2 in our project.
    We have set of requirements
    1)To throw a confirmation dialog box when user tries to navigate away from page with out saving the data changes. It includes browser closure, back button and refresh as well along with other application navigation links.
    2) upon clicking ok we need to save the current JSF form and redirect to where user is intended to navigate.
    Please let me know the best ways of implementing the above requirements.

    For the first point, I totally agree with Raymond and you can use the javascript function like this:
    <script>
    window.onbeforeunload =
    function(){
    if((window.event.clientX<0) || (window.event.clientY<0)){
    //create new confirm window here
    //I guess you can check on opening a new JSF page itself as a pop up.
    //in that page with normal form and submit buttons, I guess you can call JSF action methods.
    </script>

  • Confirm Dialog?

    As a flex newbie with a pretty good understanding of
    Javascript, I was thrilled to find the Alert.show() function
    available to replace the alert() function I often used in
    Javascript. That got me wondering... is there a corresponding
    function for the confirm() function as well? I tried
    Confirm.show(), but with no luck, as that shows up as an undefined
    property.
    I was hoping there's a simple way to activate modal
    confirmation dialogs, as I'd hate to have to build an entire
    component just for that.
    Thanks,
    Josh

    Well, there is an relative simply solution for this:
    Make a button with calls a function when clicking:
    <mx:Button label="Click Me"
    click="clickHandler(event);"/>
    Use the following implementation of the eventhandler:
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.CloseEvent;
    // Event handler function uses a static method to show
    // a pop-up window with the title, message, and requested
    buttons.
    private function clickHandler(event:Event):void {
    Alert.show("Do you want to save your changes?", "Save
    Changes", 3, this, alertClickHandler);
    // Event handler function for displaying the selected Alert
    button.
    private function alertClickHandler(event:CloseEvent):void {
    if (event.detail==Alert.YES)
    status.text="You answered Yes";
    else
    status.text="You answered No";
    ]]>
    </mx:Script>

  • Conditional confirm dialog with button

    Hi all,
    I want to create a confirm dialog with submit button that can fire only if one item is not submitted in that page.
    i have one check box item in my page called P2_LWF
    i created confirm dialog with button using the below code
    javascript:if (confirm('Are you sure you want to proceed?')) {
    this.disabled=true; this.value='Submitted...';
    doSubmit('SUBMIT');
    The moment i click submit button i want to fire that confirm dialog only if P2_LWF is unchecked.
    How can i do that in my application?
    Regards,
    Anees

    Hi marko,
    find application link below
    http://apex.oracle.com/pls/apex/f?p=14972:1:25026364614886:::::
    user name: [email protected]
    pswd: symphony
    you can access my work space using below credentials
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    workspace : aneesmohd
    username : [email protected]
    paswd: symphony
    application name: Confirmation Dialog
    application id= 14972
    when i press submit button i can get the confirmation dialog,but i want to make that as conditional (only when dl and lwf checkboxes are not ticked).if those are ticked i want to submit without getting the confirmation dialog.
    and want to clear the employee region cashe(report region) ones submit button pressed or refresh the page.
    Regards,
    Anees
    Edited by: anees_mohd on Jan 16, 2013 3:25 AM

  • Confirmation dialog box in JSf

    Hi,
    I have a Save (type 'Submit') button which onClick should give me a confirmation dialog box with Ok and Cancel.
    Ok would go ahead with the process and cancel would take me back to where the page was before the save button was clicked.
    Any help is really appreciated.
    Thanks.

    Hello,
    I hope you can invoke a javascript function when the user clicks on "Save" button (onClick event for save button). Specify window.confirm(....) inside your javascript function which will give you confirmation window. I am not well enough how you want to handle navigation in your page.

  • Confirmation Dialog Box Appears Disappears

    Hi,
    I am facing a problem here on Same os win 98 using different versions of Java run time environment.
    The code is supposed to work in this way.
    Applet is initiated by a click. a confirmation dialog box appears askign for input from a user in the form of a Yes or a No. if the user clicks Yes the applet continues otherwise it terminates.
    while using 1.4.1_02 This problem occurs that the Confirmation dialog box appears and then disappears for the jar is being downloaded.
    But using 1.3.1_04 gives no problems and the Confirmation box does not disappear.
    Regards,
    Saurabh

    Hmmm, are you running 10.6.8 or later & installed the Security updates?
    Java was an attack vector for FlashBack.
    Disable Java in your Browser settings, not JavaScript.
    http://support.apple.com/kb/HT5241?viewlocale=en_US
    http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
    http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets
    Flashback - Detect and remove the uprising Mac OS X Trojan...
    http://www.mac-and-i.net/2012/04/flashback-detect-and-remove-uprising.html
    In order to avoid detection, the installer will first look for the presence of some antivirus tools and other utilities that might be present on a power user's system, which according to F-Secure include the following:
    /Library/Little Snitch
    /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
    /Applications/VirusBarrier X6.app
    /Applications/iAntiVirus/iAntiVirus.app
    /Applications/avast!.app
    /Applications/ClamXav.app
    /Applications/HTTPScoop.app
    /Applications/Packet Peeper.app
    If these tools are found, then the malware deletes itself in an attempt to prevent detection by those who have the means and capability to do so. Many malware programs use this behavior, as was seen in others such as the Tsunami malware bot.
    http://reviews.cnet.com/8301-13727_7-57410096-263/how-to-remove-the-flashback-ma lware-from-os-x/
    http://x704.net/bbs/viewtopic.php?f=8&t=5844&p=70660#p70660
    The most current flashback removal instructions are F-Secure's Trojan-Downloader:OSX/Flashback.K.
    https://www.securelist.com/en/blog/208193454/Flashfake_Removal_Tool_and_online_c hecking_site
    More bad news...
    https://www.securelist.com/en/blog/208193467/SabPub_Mac_OS_X_Backdoor_Java_Explo its_Targeted_Attacks_and_Possible_APT_link

  • Displaying Multiple Sentences in Confirmation Dialog Box

    Hi Experts,
    Can anybody please tell me how to display three or multiple separate sentences in a Confirmation
    Dialog box. I am able to diaplay two sentences in a single line but the dialog box is getting stretched a
    lot. So i want to diaply them in separate sentences onr below the other.
    Thanks a lot.

    Hi shrini...
                   you want to number of line display in one dialog box ..
                  you have to declare one Strinh like thiss as below..
    have to create one event method as OK...which is visible in eventhandler code as
    findInEventHandlers("OK");
    create one method in component aas showBox....
    public void showBox( )
        //@@begin showBox()
         String   dialogText="welocme to""\n""India""\n".........................
          IWDEventHandlerInfo info=wdControllerAPI.getControllerInfo().findInEventHandlers("OK");
         IWDConfirmationDialog win=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,info,"OKK");
      win.open();();
    thanks
    jati

  • File download element in confirmation dialog box

    Hi,
    Can I use File Download elements in Confirmation Dialog Box?Please raply me as early as possible.
    Regards
    Aniruddha

    Hi
    You can not use  File-Upload UI element inside confirmation dialog ,because there is no provision to add any UI ,except Button.
    Please avoid  my previous reply .
    Best Regards
    Satish Kumar
    Edited by: satish jhariya on Mar 3, 2009 11:29 AM

  • How to get  the choice clicked by the user on a Confirmation dialog?

    Hi,
    'm trying with Confirmation dialog which should return
    'yes', 'No', or 'Cancel'
    I wrote like:
    String Message="Do u want  to update ??";
         IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
         IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow( Message, controllerInfo.findInEventHandlers("Yes"), "Yes");
         dialog.addChoice(controllerInfo.findInEventHandlers("No"),"No");
         dialog.addChoice(controllerInfo.findInEventHandlers("Cancel"),"Cancel");
         dialog.open();
    It works as a normal dialog window
    But how can I get the choice that is clicked by the user.
    ie . either 'Yes', 'No', or 'Cancel'.
    can any body help me
    thanks
    Smitha

    Smitha,
    In addition to your code, create 3 event handlers in your controller, name them Yes, No, Cancel. In every event handler you know what event was fired, i.e. what button is pressed.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Is there an easy way to implement a confirm dialog?

    Hi All,
        I'm wondering is there an easy way to show an confirm dialog to user with out create a new view manually?
        Thanks,
    YiNing

    Hi ,
    use the below code for confirmation box , with 2 options "OK "
    and "Cancel"
    IWDControllerInfo controllerInfo =     wdControllerAPI.getViewInfo().getViewController();
    IWDConfirmationDialog dialog =     wdComponentAPI.getWindowManager().createConfirmationWindow
                                    ( String dialogText,controllerInfo.findInEventHandlers                                ("ok"),"Ok");
                        dialog.addChoice(controllerInfo.findInEventHandlers                                          ("cancel"), "Cancel");
                        dialog.open();     
    Thanks,
    Sunitha Hari

  • DW CS3 does not display confirmation dialog when checking out file

    We have 3 developers set up with DW CS3 Version 9 build 3481.
    When checking out a file that is already checked out one pc will
    display a dialog box to confirm that you want to check-out the file
    as it is already checked out by someone else. This is good as we
    want this dialog to appear. However on the other 2 pc's there is no
    dialog box displayed and the checkout process continues as if the
    file was never checked out.
    The text of the confirmation dialog box reads as such :
    "index.cfm is checked out by first.lastname. Are you sure you want
    to override his/her checkout?". I have been through the preferences
    and verified that we have setup the sites in the same manner but we
    still have this issue.
    Is there a known bug regarding this feature? Is there a
    preference setting somewhere that I have missed?
    thanks

    Are each of your developers sharing the same local site?
    That's why you are
    getting this error if they are. The proper setup would
    involve THREE
    locations:
    1. Local sites (unique to each workstation)
    2. Staging server (shared by all workstations)
    3. Production server (the live site)
    You would have TWO site definitions, which would be -
    (for each workstation)
    1. Local = #1 (unique location for each workstation)
    2. Remote = #2
    (for one MASTER workstation)
    1. Local = #2
    2. Remote = #3
    Use the first site definition for day-to-day work and
    checking files in/out.
    Use the second site definition ONLY for pushing files from
    the staging
    server to the production server.
    That's the only way it will work....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "bemor" <[email protected]> wrote in message
    news:g3ojq5$4il$[email protected]..
    > We have 3 developers set up with DW CS3 Version 9 build
    3481. When
    > checking
    > out a file that is already checked out one pc will
    display a dialog box to
    > confirm that you want to check-out the file as it is
    already checked out
    > by
    > someone else. This is good as we want this dialog to
    appear. However on
    > the
    > other 2 pc's there is no dialog box displayed and the
    checkout process
    > continues as if the file was never checked out.
    >
    > The text of the confirmation dialog box reads as such :
    "index.cfm is
    > checked
    > out by first.lastname. Are you sure you want to override
    his/her
    > checkout?". I
    > have been through the preferences and verified that we
    have setup the
    > sites in
    > the same manner but we still have this issue.
    >
    > Is there a known bug regarding this feature? Is there a
    preference
    > setting
    > somewhere that I have missed?
    >
    > thanks
    >

  • Icon in Confirmation dialog

    Hi everyone, I need help for my problem. I want do display confirmation dialog with icon and i find that i must using method setIcon(WDURLGenerator.getSAPIconWebResourcePath("???")). I have read the help about WDURLGenerator but still i cannot understand what parameter that i must use in this method (getSAPIconWebResourcePath(...)). I have try fill this methos with this : "~sapicons/s_b_disp.gif" but it not works. Anyone can explain this to me ? Thank you.
    Regards,
    Satria

    Hi ,
    For your actual question , it would be
         getSAPIconWebResourcePath("s_b_disp.gif") ;
    And as far as i know , using a ~sapIcons .. would inturn use the same function..!
    Maybe give this function a try ! Also , check if the sapIcons folder exists in the server
    usr/sap/...server0/ and then search for it ..
    Regards
    Bharathwaj

Maybe you are looking for

  • Retrieving data into internal table

    Hi,      I am struck at a point where i have to retrieve data from 4 database table to a single internal table with some conditions. can anyone please help me in resolving this issue. your help will be highly appreciated. some details are: tables use

  • IOS 4.2.1 Bluetooth audio streaming problem

    My iPod touch paired & connect to bluetooth headset. but, every time I play a music I can only hear it for 1 second. After that? total silent. I tried forget the device and re-paired the device. But the problem still persist. Back when I used iOS 4.1

  • Sales Process for Packaging material (VERP)

    Hi All, I have a business requirement to set up the sales process for Packaging materials and the material type is VERP. But system will not allow me to create Sales order using the same material because material category VERP needs to be added for t

  • Slow change dimension

    Hi al, How slow changing dimension will support SID? The following is the advantages with SLOW CHANGING DIMENSION. 1)language support 2) master data independent of infosource 3) uses numeric as indexes for faster access. plz explain the above points

  • How to increase the heap space size -is there any parameter to pass to JVM

    I created a memory buffering module which can be use to buffer log records and write to hard disk.disk writing is done by a separate thread so the main application won't be delayed. and memory for new errors are allocated dynamically. when i test thi