Jump to content
  • 0

How to run a javascript after caspio validation in Form submission



I was wondering if anybody here could help me on this one.

I'd like to run a javascript to validate form fields before submission but after caspio own validation. Let me be clearer. I've already set a few constraints like minimum and maximum number of characters, for instance, but I have some further checks I'd like to add to validate fields before the form is submitted. I want to make sure Caspio checks run first and then and only then, if everything is OK, I want to run my script which contains further and more strict validation rules.

Example: I want to verify that a mobile number begins with "04" (Australian mobile number) but only after all the other basic checks have been performed (length within the limit, etc.).

Is there any way to do that? I couldn't find any.

Thank you.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Paolo,

Caspio offers custom events if you have AJAX enabled.

The one that you need to use called "BeforeFormSubmit" it occurs after user clicks on "Submit" button, but unfortunately before the default form validation checks(*required) happens.

I can suggest to write all validation needed in JavaScript and use "BeforeFormSubmit" event.

Here is documentation: https://howto.caspio.com/datapages/ajax-loading/

Hope this helps.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...