How to prevent submission of form on onchange client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 02:15 AM
Hi Team,
We have a on change client script and script include to fetch the value from table and do validation,but the issue is even if the value is incorrect the form is getting submitted,which should not be the case. Below is script include and client script.
Script Include-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 02:33 AM
Why would onChange be used for validating the submission, better use onsubmit client script or before BR if you want to validate something before submission.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 02:50 AM
Hi Aman,
How can I use the validation of same field on onsubmit client script.
I used the below script for ONSubmit
Thanks,
Karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 04:53 AM
For onsubmit, you can't use Async ajax, as the form will not be held until the response from server comes back. Try changing this to getXMLWait, then it will work as expected which makes Sync ajax call
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2025 04:27 AM
Hi Amam,
Can we use anything except getXMLWait because this function won't work in the scoped application.
