- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 04:42 AM
Onsubmit catalog client script not working properly. Need to display an errormessage for some specific countries selected on the catalog form & disable the submit button simultaneously. We have written an on submit client script for that where we are checking the condition and then returning false, which seems to work perfectly but only the first time we click on submit button.
If someone modifies to a correct country and then click on onsubmit again, submit functionality doesn't seem to work and request is not getting raised.
snap of the onsubmit script:
Any help regarding the same is appreciated.
Thanks,
Aindrila
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 05:16 AM
Yeah that is because, the onsubmit cline script will only when there is a submit action performed on the portal.
I would suggest you this:- Change the script to Onchange client script and then if the user select wring country you show them the error message but also clear out the country field using g_form.clearValue('countryvariablename').
So this way you will be able to show them the error message and they will also have to select the correct country before proceeding further
Please mark my country as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 05:16 AM
Yeah that is because, the onsubmit cline script will only when there is a submit action performed on the portal.
I would suggest you this:- Change the script to Onchange client script and then if the user select wring country you show them the error message but also clear out the country field using g_form.clearValue('countryvariablename').
So this way you will be able to show them the error message and they will also have to select the correct country before proceeding further
Please mark my country as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 05:35 AM
Thanks for this solution this sounds and works better.