Abort Form Submission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 11:11 AM
Hi all,
I have the below requirement.
In my catalog form, I have a variable called vendor(string). When the form is submitted, the information is saved in a custom table with the same column name (vendor).
So, if I enter any text in the variable vendor field, it should check the data in the custom table vendor field and prevent form submission if duplicate data is found.
How could we achieve this?
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 07:13 PM
Hey Nag,
It looks like your Client Script is set to onChange when the check on whether we want abort the submission of an item should be done in an onSubmit catalog client script. You will need to either change your current script to onSubmit, or create a new client script that performs the check onSubmit.
With that in mind, in your onSubmit catalog client script, simply add the following line of code to where you want to abort the submission.
return false;
Please mark this answer correct or helpful if it solved your issue, thanks!