-
sudipsahaAsked on January 22, 2016 at 12:42 PM
Hi,
I created several forms with Jotform. I am trying to write validation function in javascript by adding the attribute onsubmit. The functions get fired when I submit the form, but the form still get submitted. I tried to work with the similar form which doesn't have any jotscript function and that works perfectly. Can you please advise how can I add validation function of my own in jotform.
ThanksSudip Saha
-
David JotForm SupportReplied on January 22, 2016 at 1:44 PM
Hi,
It is not possible to add javascript directly in the form. You can, however, get the full source code of your form and insert your validation in that code:
http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form
-
sudipsahaReplied on January 22, 2016 at 2:45 PMHi
Thank you for your response. I am adding the validation function. But for
some reason, the form get still submitted when onsubmit returns false.
Thanks
Sudip Saha
... -
David JotForm SupportReplied on January 22, 2016 at 3:46 PM
I believe the form will still submit as long as it passes the JotForm validation. Your validation requirements would not need to be met in order to complete the form.
-
sudipsahaReplied on January 22, 2016 at 4:45 PMHi David,
Thank you for your response. How can I add my validation requirement with
the JotForm requirement. Is this possible?
Thanks
Sudip Saha
... -
Kevin Support Team LeadReplied on January 22, 2016 at 6:08 PM
Hi,
You will find the default validations on the top toolbar :
You may also add a mask to your field :
However, the mask does not avoid to submit the form, and as explained by my colleague, it's not possible to add your custom validation, since it's not possible to add custom Javascript codes.