PresaveAction() Popup message box with save and cancel button

Hi,
I want to give user an option from popup box with the message "Are you sure to Save you record".
I got below javascript code but don't know how to show two buttons on popup if user wants to recheck before final saving then he should click CANCEL otherwise SAVE button.
<script type="text/javascript">
function PreSaveAction()
alert("Your request has been submitted");
return true;
</script>
Please advise in above code. 

Hi,    
For your requirement, you can use the JavaScript Confirm Box which will contains two buttons in a popup window.
Here is a demo about checking the value in the “Title” field, if it equals “asdf”, then a Confirm box will come out, then user will be able to choose whether to save or not.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
function PreSaveAction()
var txtStatus = $j(":input[title='Title']").val();
if(txtStatus == "asdf")
alert("Invalid Input");
var r=confirm("Are you sure to Save you record?");
if (r==false)
var statusfocus = $j(":input[title='Title']");
statusfocus .focus();
return false;
else
return true;
</script>
Feel free to reply if there still any questions about this.
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Creating a dialog box with OK and Cancel buttons without OADialogPage

    Hi Experts,
    i want to create a dialog box for Delete Confirmation means after clicking on delete it should pop up a small dialog box with OK/Cancel buttons
    and need code for the same to handle the buttons.
    i have created with OADialogPage but its showing in a complete page but i want to show those buttons in a small box.
    Plz help.
    THANKS IN ADVANCE.
    Thanks
    Raja.

    Hi,
    I have not tried using javascript in destination URI as suggested by Mukul.
    I have tried the below code for opening a page as dialog box.
    You can try it for your requirement by creating a dialog page of your own, say XXDialogPage (with OK and Cancel button)
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?page=/xx/oracle/apps/fnd/dialog/webui/OADialogPG";
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:500, height:500},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    In dialog page's controller, you can forward it to the page onc ethe user selects OK or Cancel.
    Pass the selected value back to the main page and further you can use it for deleting.
    Regards.

  • How to display warning message box with yes and no buttons

    Hi,
    I am writing the code to delete emp details from database.
    I want to display warning message with yes and no buttons after clicking the delete button in the same page, if yes is clicked, i want to invoke delete() method in AM.
    Is it possible, if yes pls suggest me how to do it.
    Thanks
    Message was edited by:
    user536125

    This is being discussed in
    warning message(dialog page) to be displayed in the same page
    Thanks
    Tapash

  • Unable to disable Save and Cancel button on change user answer form

    Hi,
    I am not able to disable Save and Cancel button on change user answer form depending on a condition. Any kind of help will be appreciated.
    Thanks

    save and cancel are the default buttons
    check the disable default buttons...
    Nsankar

  • Pop up box with Ok and Cancel choices, not working. Please Help.

    Hello! I am trying to create a pop up box that allows users to choose Ok and Cancel (i'm just testing with Ok and Cancel for now). For some reason when I run it a CMD line pops up and closes very quickly, but i do not get errors. Here is my code:
          private void button1_Click(object sender, EventArgs e)
                PopupForm popup = new PopupForm();
                DialogResult dialogresult = popup.ShowDialog();
                if (dialogresult == DialogResult.OK)
                    Console.WriteLine("You clicked OK");
                else if (dialogresult == DialogResult.Cancel)
                    Console.WriteLine("You clicked either Cancel or X button in the top right corner");
                popup.Dispose();
    Please help! 
    Thanks
    - Rocketman123

    Hi Rocketman123,
    Per my understanding, you are developing a winform application, but in your code, I see "Console.WriteLine".
    So please use MessageBox.Show() instead.
    http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(System.Windows.Forms.MessageBox.Show);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with SAVE and RESET button in WAD

    Hi all,
    We have two queries embedded in save template and we have created two different save and reset buttons for each query. But if i execute save or reset for one query it is working for both the queries. Can i restrict the SAVE and RESET button for a particular query.

    Hi Tilak,
         It appears that though there are two reset buttons, the HTML code for the webtemplete is not arranged to restrict the reset function of the button for each dataprovider used. This may cause the reset function to act globally on all dataproviders . In the XHTML code, please pass a unique instruction to each reset function, such that each instruction corresponds to a unique dataprovider.
    Thanks,
    Nithin Reddy

  • My iphone 4 started displaying a message box with the following message: "This accessory is not optimized for this phone. You may experience noise and loss of battery."  My question is: how to fix this?

    My iphone 4 started displaying a message box with the following message: "This accessory is not optimized for this phone. You may experience noise and loss of battery."  My question is: Why is this happening and how do I fix it? (I'm losing battery power precipitously). Thanks in advance for any assistance with this question.

    Thanks Kilted Tim, you solved the problem. I'm mightily impressed at the simplicity of the solution!
    Jaded Kane

  • I updated my Itunes to the latest version(11.1.4) and it isn't running on my laptop. The current OS is a W7 ultimate 64bits, when i try to run it, opens a message box with the following error message: error 7 (windows error 1114) . What should I do?

    I updated my Itunes to the latest version(11.1.4) and it isn't running on my laptop. The current OS is a W7 ultimate 64bits, when i try to run it, opens a message box with the following error message: error 7 (windows error 1114) . What should I do?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • HT4463 I keep getting the message "The application could not be downloaded. The installation could not be started."  with a "Retry" and "Cancel" button,  I have been re-trying for several hours to no avail.  What is the problem?

    I keep getting the message "The application could not be downloaded. The installation could not be started."  with a "Retry" and "Cancel" button,  I have been re-trying for several hours to no avail.  What is the problem?

    You'll need to contact support and have them check your account
    https://expresslane.apple.com/GetproductgroupList.action

  • JS confrim popup message box - How to change it into yes or no button?

    confirm popup message box is always with OK or Cancel Button?
    How to change it into Yes or No Button?
    Thank you.

    I don't think you can change those buttons. However you may try use some rich Javascript library like YUI (Yahoo! User Interface) to pop up custom alert and confirm boxes.
    See [http://developer.yahoo.com/yui/examples/container/simpledialog-quickstart.html]
    Cheers,
    Hari

  • I need to install Adobe Flash Player but there is no RUN to click on to download to the Programs Folder. Only Save and Cancel.

    I just installed Firefox after many problems with IE and when I try to manually install Flash Player it says to click on RUN in the box. I have 2 choices - Save and Cancel. If anyone can help me with this I need it simple because this is totally new to me on Firefox.

    SAVE it to your hard drive in a place where you will be able to find it. After download is complete, click or double-click on the file you downloaded to start the install.
    #'''Install or Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''.
    #**http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    #**Note separate links for:
    #***Plugin for Firefox and most other browsers
    #***ActiveX for IE
    <br />
    '''Other issues that need your attention'''
    The information submitted with your question indicates that you have out of date plugins with known security and stability issues that should be updated. To see the plugins submitted with your question, click "More system details..." to the right of your original question post. You can also see your plugins from the Firefox menu, Tools > Add-ons > Plugins.
    *Adobe Shockwave for Director Netscape plug-in, version 11.5.8.612
    *Adobe PDF Plug-In For Firefox and Netscape "9.4.1"
    *Java Plug-in 1.6.0_02 for Netscape Navigator (DLL Helper)
    **21 updates behind, including several security fixes
    **Firefox 3.6+ needs at least Java 1.6.0_10
    **<u>You should un-install the old version before downloading and installing the new version</u>. See link to un-install old versions below
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**Use the links below to avoid getting the troublesome "getplus" Adobe Download Manager and other "extras" you may not want
    #**Use Firefox to download and SAVE the installer to your hard drive from the appropriate link below
    #**Click "Save to File"; save to your Desktop (so you can find it)
    #**After download completes, close Firefox
    #**Click the installer you just downloaded and allow the install to continue
    #***Note: Vista and Win7 users may need to right-click the installer and choose "Run as Administrator"
    #**'''<u>Download link</u>''': ftp://ftp.adobe.com/pub/adobe/reader/
    #***Choose your OS
    #***Choose the latest #.x version (example 9.x, for version 9)
    #***Choose the highest number version listed
    #****NOTE: 10.x is the new Adobe Reader X (Windows and Mac only as of this posting)
    #***Choose your language
    #***Download the file, SAVE it to your hard drive, when complete, close Firefox, click on the installer you just downloaded and let it install.
    #***Windows: choose the .exe file; Mac: choose the .dmg file
    #*Using either of the links below will force you to install the "getPlus" Adobe Download Manager. Also be sure to uncheck the McAfee Scanner if you do not want the link forcibly installed on your desktop
    #**''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #**Also see: https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox (do not use the link on this page for downloading; you may get the troublesome "getplus" Adobe Download Manager (Adobe DLM) and other "extras")
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • APEX 41 Field Help like popup message box

    I am using Apex 4.1
    And would like to use a similar popup message box to what Apex has when you click on a label that has help defined.
    For a list that is created in shared area I am wanting to use the userdefined area 1 as the message text to tell users a bit more about an icon option when they take their mouse over the field label.
    Is the popup message that is used for HELP something that can be called.
    I saw in previous posts about creating a separate form and calling it through a java script call. It can't still be that difficult in 4.1 since they have the field level help.
    Any help is appreciated.
    greG

    You're welcome, and thank you for providing further details of what you did.
    To make things look like this
    my_code := 'readable';in future, try surrounding your code with these tags like

  • Macbook froze while online. hard shutdown. when it restarted, an error message appeared saying finder shut down unexpectedly containing a message box with a long list of technical jibberish.  after clicking OK that it would send an error report to Apple,

    macbook froze while online. hard shutdown. when it restarted, an error message appeared saying finder shut down unexpectedly containing a message box with a long list of technical jibberish.  after clicking OK that it would send an error report to Apple, the same error message box appeared again and again every time OK was clicked.  Now the macbook will not turn on at all

    If you're able to boot, launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Console in the page that opens.
    Select the most recent panic log under System Diagnostic Reports. Post the contents — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post "shutdownStall" or "hang" reports.
    If you can't boot in the usual way, try a safe boot. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    During startup, you’ll see a progress bar, and then the login screen, which appears even if you normally log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Safe mode is slower than normal, and some things won’t work at all.
    Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.

  • How to handle "ok" and "cancel" button of dialog popup?

    Hello everyone,
    I'm using a dialog with type="okCancel". My question is how to handle ok and cancel button of this popup window. Here is my code below:
    <af:popup id="kriterPopup">
    <af:dialog title="Kriter Seçiniz" type="okCancel" inlineStyle="width:500px;height:400;" id="d2"
    dialogListener="#{BasvuruDegerlendirmeBean.kriterDialog}">
    <af:selectManyCheckbox label="Kriterler :" id="smc2"
    binding="#{BasvuruDegerlendirmeBean.kritersCheckbox}">
    <af:forEach items="#{BasvuruDegerlendirmeBean.kriterList}" var="item">
    <f:selectItem itemLabel="#{item.ybKriter.tur}" itemValue="#{item.ybKriter.tur}" id="si3"/>
    </af:forEach>
    </af:selectManyCheckbox>
    </af:dialog>
    </af:popup>
    I want to handle ok and cancel button of this window, and redirect to the pages which I want.
    Can anyone help me how I can do?
    Thanks, with my regards.
    Ali

    You need dialogListener..
        public void dialog1_dialogListener(DialogEvent dialogEvent) {
            if (dialogEvent.getOutcome().equals(DialogEvent.Outcome.yes)){ //for Yes
            }else{ //for Cancel
        }

  • Firefox 4 displays multiple message boxes with "uninstall set'. How do I stop this?

    Firefox 4 displays multiple message boxes with "uninstall set'. They cannot be closed and they freeze Firefox. The only way to stop is to END TASK through the Task Manager.
    OS: Vista) with all service packs and updates as of 21 Apr 2011. All other browsers and applications are closed.

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    See:
    * [[Troubleshooting extensions and themes]]

Maybe you are looking for