Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

How to chek condition on Submit button

Avatar

Former Community Member
Hi All,

I want my form should submit action only if it is full filling certail condition and this validation should be done only before submit.



But when I am writing any code on click of submit button my submit button is not working properly.(Not able to subit the form to URL).



Let me know if some one have any exp on this?



Thanks in Advance



Abhishek
1 Reply

Avatar

Former Community Member
Hi Abhishek,



Have you tried using the preSubmit event? I have pasted the description of the event from Designer's on-line help below.



preSubmit event

Event type: DOM oriented events



This event triggers whenever a form submits data to the host via the HTTP protocol. At this point the data is organized into a data set, but has not been sent to the host. Scripts associated with this event have the chance to examine and alter the data prior to the form submission. If the script is set to execute at the server, the form sends the data to the server with an indication that it should run the script before performing any additional processing.



The preSubmit event applies only to the Form DOM. Note that the preSubmit event does not distinguish between submissions initiated by different button pushes or to different URLs. Any script that needs to make these distinctions must include code to find out what button was pushed. In general, preSubmit is analogous to preSave and serves a similar purpose.



See also

preSave event



Denver

Adobe Enterprise Support