4 Replies Latest reply on Nov 6, 2012 11:43 AM by david_mtl

    Getting Submit URL ?




      I have a form with 2 submit buttons, each one submit to a specific URL. I d like to add some custom validation to only one of them. When I add this custom javascript code to one of them within the pre-submit event, it's applied to other submit button.


      Is there a way to differentiate the submit button clicked like based on submit URL ?

      I'm really blocked, Will appreciate your help!!




        • 1. Re: Getting Submit URL ?
          Raghu Nagireddy Level 3

          As this custom script need for only one button, can move that script to click event itself and can take care the things, if this code block not thru can cancel the rest of the steps.


          If need to place on pre-submit it self:

          1. Place a new field on form as hidden field, ex: flagField.

          2. Assign some specific text/number for "flagField" on click of the Submit button which is required to execute custom code, If click on another submit clear "flagField"  value or assign different text/number.

          2. Now on pre submit, do compare with "flagField" value and execute custom code script for required button.

          • 2. Re: Getting Submit URL ?
            david_mtl Level 1

            Hi Raghu,


            Thanks for your quick reply.

            The big issue  is that buttons of type Submit do NOT have click event. Otherwise, I know how to deal with.

            But, since there is no click event and pre-submit event is applied to all buttons of type submit, I don know how to control this specefic button.


            Thanks in advance for any ideas!



            • 3. Re: Getting Submit URL ?
              Raghu Nagireddy Level 3

              Please check the sample pdf provided in with the link: https://acrobat.com/?d=VChGiMs8Cs8EKx3lCgkhTA


              In this added 2 more button as "Regular" type ones (current you may have "Submit" type ones). "Submit" buttons made as "Invisible" and on click of "Regular" button assign some "flag" and compare that flag on "preSubmit" event. can add custom script on click of "Regular" button before calling the actual "Submit". If you tried already this approach please ignore this.



              • 4. Re: Getting Submit URL ?
                david_mtl Level 1

                Thank you soo much  Raghu !! You really saved my life. I was blocked there since 1 day.

                I owe you a Beer man


                Thanks again.