Manually created submit buttons & mandatory fields

Hi,
I included a Submit & an Email button in some of my forms.  I've set them up as Regular buttons and coded them myself to do what I want eg:
if(xfa.host.messageBox("Please save this form before emailing or data will be lost","Save Form",1,1))
    app.execMenuItem("SaveAs");
var sEmail = form1.Pg2.PtESF.Mgremail.rawValue;
var sSubject = ("Permit to Train Request by " + form1.Pg1.PtASF.FirstNameFld.rawValue + " " + form1.Pg1.PtASF.LastNameFld.rawValue);
var sBody = "Please approve the Permit to Train Request as attached.";
event.target.submitForm({cURL:"mailto: "+ sEmail +"?subject=" + sSubject +"&body=" + sBody,cSubmitAs:"PDF",cCharset:"utf-8"});
If I set them up as Submit buttons, they don't try to run the script more than once.  I assumed this was because I had the code built in with the Submit option and it ran that as well as my own code.
So I changed the button to be a Regular button and then it worked perfectly - except for one thing.
It no longer validated the mandatory fields.
Can anyone tell me what's built into the Submit button (that I can't see), that I need to reproduce in my script for my regular button?
Thanks,
Peta

Hi,
The Submit buttons validate the from behind the scenes.
You can use execValidate() in an if statement, and if passes then execute script.
See an example here for execValidate():
http://assure.ly/hM2A5y (see last button)
http://assure.ly/flbjXB
Both of the above examples use validationState and cancelAction so are targeted to Acrobat/Reader version 9.1. Please note that execValidate() can be used in earlier versions:
http://assure.ly/lZhrSS
http://assure.ly/dYQFb4
Hope that helps,
Niall

Similar Messages

  • Create Submit button programatically

    Hi,
    Can some body help me with creation of submit button programatically.under page button bar region(Existing region on page)
    Thanks

    Hi,
    Please refer http://apps2fusion.com/apps/oa-framework/214-sample-code-add-submit-button-using-oa-framework-extension
    before adding button to pagebutton bar first get handle to page button bar region, then create submit button through code and then add it to page button bar.
    Regards,
    Reetesh Sharma

  • Created "submit" button not working with Reader

    I have created a submit button that will submit an email based off dropdown menu selection.  While it works great on my computer (Pro).  A user with Reader (9.0) can fill out everything until the (java created) submit button.  The user computer hangs...  Any ideas of what the issue could be?
    Thanks,
    Jo

    Thanks for the feedback, I figured it out.  Silly me, didn't have the form user-enabled.
    Jo

  • Hidden Email Submit Button & Mandatory Check Boxes

    Hi guys
    I'm trying to get my form to only allow people to return the form (via email) once they have accepted the terms and conditions AND the privacy policy.
    Their acceptance of these is confirmed by 2 check boxes called acceptservicesterms and acceptprivacypolicy respectively. For each of these check boxes I have added this script to 'initialise':
    this.mandatory = "error";
    this.mandatoryMessage = "You must accept our Services Booking Terms and Conditions to request a booking";
    I have then set my email submit button (EmailSubmitButton) to 'hidden (exclude from layout)' and created a 'fake' email submission button in its place. The click event for the FakeEmailSubmitButton is scrpited as:
    if (acceptserviceterms.rawValue != "bookingtermsagreed")
    xfa.host.messageBox("You must accept our Services Booking Terms and Conditions to request a booking");
    else if (acceptprivacypolicy.rawValue != "privacypolicyagreed")
    xfa.host.messageBox("You must accept our Privacy Policy to request a booking");
    else
    EmailSubmitButton.execEvent("click");
    Where the 'on' values are 'bookingtermsagreed' and 'privacypolicyagreed' respectively.
    Unfortunately, this hasn't worked for me - I'm not sure if the javascript is completely correct, or if I have gone about this the right way. Can anyone shed any light on what I've done wrong please?
    Thanks in advance

    if (acceptserviceterms.rawValue != "bookingtermsagreed")
    in this line the field name is acceptservicesterms but u typed as acceptserviceterms - letter s missing.
    after this correction i am able to see the error messages.

  • Dynamic Submit Button- Required Fields

    I needed a dynamic submit button that would cc a field from the form.  I found the following script and it works great, but it doesn't give an error message if someone didn't fill in a required field like a regular submit button would. Is it possible to use the script below but to check for required fields?
    // This is the form return e-mail. Its hardcoded
    // so that the form is always returned to the same address
    // Change address on your form
    var cToAddr = "[email protected]";
    // First, get the client CC e-mail address
    var cCCAddr = RegionalDirector;
    // Set the subject and body text for the e-mail message
    var cSubLine = "909 Camp Visitation Report-" + xfa.resolveNode("#subform[0].#subform[7].Country"); var cBody = "Thank you for submitting your 909 report.\n" + "Save a copy for your records";
    // Send the form data as an FDF attachment on an e-mail
    event.target.mailDoc({
              bUI: true,
              cTo: cToAddr,
              cCc: cCCAddr,
              cSubject: cSubLine,
              cMsg: cBody

    Hi,
    stefan's example uses a method that seems a bit clumsy or maybe that was the only way it could be done in 2006.  Assuming your email button is called EmailSubmitButton yo can use;
    EmailSubmitButton.event__click.submit.target = emailtarget;
    where emailtarget is a string in this format
    mailto:emailaddress?cc=emailaddress?bcc=emailaddress?subjext=text?body=text
    The bold parts you can't change but you can leave out, except for the mailto and the to email address that follows it.
    Regards
    Bruce

  • Create submit button through extension

    hi guys i have a requirement to create a new button on oaf page.i am extending controller and writing below code.but there is no button displaying on page.plz help me.am using jdev 9i and oracle ebs 11i.
       OASubmitButtonBean oasb= (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,"BUTTON_SUBMIT");
        oasb.setID("AssetDetails");
        oasb.setUINodeName("AssetDetails");
        oasb.setEvent("AssetDetails");
        oasb.setText("AssetDetails");
        webBean.addIndexedChild(oasb);
    Note:region type is defaultDobuleColumn where i am trying to add button.
    Please Please help me

    1)
    first of all you need to find the parent bean (defaultDobuleColumn)
    something like this :
      parentWebBean =  webBean.findChildRecursive("Name of the Parent Object");
    and then parentWebBean.addIndexedChild(oasb);
    2) At the same time you can add the submit button using personalization.

  • While creating info record mandatory fields are disable .

    hi all,
    while creating info record some  mandatory fields are disable (valid to) in condition what i can do to procede further?
    how i fill data in that  field?

    Hello,
    I think that is set as a mandatrory field. You can give any values in days here. Enter 1 or 2 and proceed.
    Prase

  • How to disable programmatically created Submit Button in ProcessFormRequest

    Hi All,
    I'm working on an issue where i have created an Upload button Programmatically. The upload button should get disabled after it is clicked. The code for the upload button creation is as below. This has been added in the processRequest of CO.
    OASubmitButtonBean oasb;
    oasb =
    (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,
    OAWebBeanConstants.BUTTON_SUBMIT_BEAN,
    null,
    "BUTTON_SUBMIT");
    oasb.setID("Upload");
    oasb.setUINodeName("Upload");
    oasb.setEvent("Upload");
    oasb.setText("Upload");
    Now, when i handle the upload button click in the processFormRequest, i should also disable the button at the end. I followed the below method in the processFormRequest but it threw a null pointer exception at the point where i have disabled the button.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    String strEvent = pageContext.getParameter(EVENT_PARAM);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (strEvent.equals("Upload"))
    OASubmitButtonBean oasb2 = (OASubmitButtonBean)webBean.findIndexedChildRecursive("Upload");
    oasb2.setDisabled(true); --- this is where the null pointer exception gets thrown
    I'm not sure if this is the way to go about it. Could you please let me know how to handle the above request?
    Regards,
    Shreyas
    Edited by: user11258661 on Mar 28, 2012 7:15 AM

    Hi Ram,
    Thank you for the response. I have created the button programmatically. So I'm not sure how to add the newly created button to the webBean as child. I'm new to OAF. So could you please elaborate. A code snippet might help.
    Thanks in advance.
    Regards,
    Shreyas

  • Create BP with mandatory fields ( BAPI )

    Hi All,
    How can I create BPs with minimum number of fields.
    please refer..
    Create BP with minimum fields ( BAPI )
    Thanks in Advance, Sudeep..

    Hi All,
    How can I create BPs with minimum number of fields.
    please refer..
    Create BP with minimum fields ( BAPI )
    Thanks in Advance, Sudeep..

  • Error after creating submit button - WebDynpro Exception

    Hi,
    I have created a form from ABAP Webdynpro and in the adobe designer I have created a submit(both native and activex) button.
    If the form is in display mode I am able to see the button , but if it is enabled I get the following dump.
    WebDynpro Exception: The ADS call has failed.
    Method: RAISE of program CX_WD_GENERAL=================CP
    Method: CREATE_PDF_XSD of program CL_WD_ADOBE_SERVICES==========CP
    Method: CREATE_PDF of program CL_WD_ADOBE_SERVICES==========CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LADOBE==================CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
    Method: CONV_VIEW_INTO_VE_ADAPTER_TREE of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: SET_CONTENT_BY_WINDOW of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Regards,
    Narayani

    Recently I cam upon a blog regarding this.

  • Partial Submit button and fields resetting

    Hello
    I have a button with partialsubmit=true
    In the button's action listner event I open a popup and this popup contain RichInputText fields.
    Before open the popup I am reset all of these RichInputText values by
    this.geRichInputText1().resetValue();
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(this.geRichInputText1());But each time I open this popup I don't see these RichInputText figures are reset. It just show off what was in the previous.
    when button's partialsubmit=false, this works.
    Is there a way to reset with partialsubmit=true
    Thanks
    Edited by: deshan on Jan 31, 2011 2:45 PM

    Try setting the contentDelivery property of your popup to "lazyUncached". Otherwise the content of the popup is cached by default.
    For more info check this: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_popup.html

  • Material Create Batch Management Mandatory Field

    Hi all,
    I would like to create material but the batch management fields in several views. Has it relation with, material type or material group or plant? And how can i disable this property for one of our plant ?
    Regards,

    >
    techmaster wrote:
    > Hi all,
    > I would like to create material but the batch management fields in several views. Has it relation with, material type or material group or plant? And how can i disable this property for one of our plant ?
    >
    > Regards,
    Batch management check once enabled, doesnot need to be enabled again in other view, its automatically enabled as they are all linked together and yes you can disable it for one plant.
    In OMSR, look up for field MARC-XCHPF which is for batch management and change the field reference to display and save
    Edited by: Afshad Irani on Apr 27, 2010 7:39 PM

  • Manually creating buttons

    Please see
    http://htmldb.oracle.com/pls/otn/f?p=24317:91
    I need a button item next to a text box to do some javascript validation and if the validation succeeds do a popupURL.
    I cant use the builtin button item because
    a) For HTML buttons, it "hogs" the onClick event to do a doSubmit(). I want access to the onClick to do my validations
    b) For template based buttons, there isnt even a option to do anything other than submit the page! There is no URL Redirect feature like for region buttons.
    So, I ended up manually creating a button using the INPUT tag in the "Post Element Text" of my text item as you can see above
    Questions:
    1. Is this (manually creating form items) in the post element text ok?
    2. Why doesnt the top of the button line up with the top of the text box? They are in the same table cell.
    Thanks

    Look into the thread
    Re: How to make a reset button

  • How can you ensure all mandatory fields are filled, before pressing the submit button?

    Hi all,
    I've got a complex form with many different pages (17 so far) and I'm using visible/hidden to change the layout so only 1 page appears at a time.
    What I want to do is have a better check for what mandatory fields have not been filled out in my form. The submit buttons checks that all of the mandatory fields have been completed, but if that's 1 field on page 1, searching through my entire document would cause the users to lose the will to live!
    I am after either returning more meaningful information to the user when a submit fails, or being able to run the mandatory check field every time the page changes. I already dynamically set most of the mandatory fields according to what is/isn't visible so adapting my form wouldn't take long but I have no idea how to get it to check if all the fields have been filled in.
    Many thanks,
    Tom

    Right, I have pretty much all of my validations working now... and here's the word you're waiting for... but, I am having a problem with fields that are already visible when the rest of the layout changes.
    Basically, one of the options above the field with the problem is being changed, which makes the layout above that field change. This is triggering the validate event.
    This wouldn't stop anyone using my form, but it is an annoyance.
    Anyone able to help?
    Many thanks,
    Tom

  • Created a form in Forms Central. Exported the PDF with Submit Button Option. When the PDF is filled out and submit clicked, it comes back asking for required fields to be filled but they already are. Any Help?

    b

    Hi;
    OK - I can clarify some things and tell you how to do what your looking for. 
    The desktop FormsCentral application tools are really designed towards create forms that do collect data on FormsCentral servers.  You can still easily create PDFs that do not submit data to FormsCentral, but you'll have to add any alternative submit functionality using the Forms tools in Acrobat.  You can create a PDF without the submit button in either case, signed in/out of the Desktop Application from the "File" - "Save as PDF Form" menu item.  You can then modify the PDF in Acrobat XI Pro by doing a "Save A Copy", when you open the copy you can edit it any way you like, adding a "Submit" button that email's the PDF/Responses back to you...
    Here's how: In Acrobat open the PDF you saved from the FormsCentral Desktop application and go to "File" - "Save a Copy" and choose a location, this will remove the security.  Open up the copy you just created and you can now edit it, here is a YouTube video tutorial using Acrobat XI, he covers the email button in about two minutes, there are lots of tutorials out there but this one is easy to follow:,
    http://www.youtube.com/watch?v=Jql1wp5Gofs
    Thanks,
    Josh Corey
    FormsCentral Team

Maybe you are looking for

  • Random lock ups with MSI P67A-GD65 (B3). Please help!

    Hello all, I just built a new system with the following components: MSI P67A-GD65 (B3) Intel Core i7-2600K Sandy Bridge 3.4GHz EVGA 012-P3-1570-AR GeForce GTX 570 G.SKILL Ripjaws X Series 16GB (4 x 4GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Therma

  • How to get  selected records from an ALV  Grid in some other internal table

    I am using a standard SAP program (RFKKMA02) in a Z program. Now i want to select some rows in ALV and after doing some modification, i want to store those records in some other internal table. I am not using OO concept. Thanks in advance.

  • Best Approach to Share Photos in Client Server Environment

    Ive been doing research on the best way to share scanned documents inside a client server application (PB11) but am not sure what's the quickest way to do it. My brainstorm came up with: 1. Use MS SharePoint to share photos.     Pros: Relatively quic

  • Photoshop CS6 Vanishing Point Font Size

    How do I make it bigger?  When you render it to photoshop you have to zoom in to see it.

  • WSAD/Ant/JUNIT problem

    Hi, I'm want to use ant to run some JUNIT tests and generate reports for the tests. I wrote the following build.xml file: <?xml version="1.0" encoding="UTF-8"?> <project name="junitTest" default="test"> <target name="init"> <property name="outdir" va