Abort Form Submission

Nag9
Tera Expert

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?

5 REPLIES 5

Ethan Davies
Mega Sage
Mega Sage

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!