- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:14 AM - edited 06-04-2024 09:17 AM
I have written onsubmit client script which will ask for confirmation before submitting the record producer.
I get the message (see attachemnt), but when I click on cancel, it is still submitting the record. How to avoid this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 12:37 AM
Realized that having a confirmation (validation) box when using async ajax is impossible. So taking tip from this video, I created a check box, which user has to check every time some value changes in the RP. Had to create many catalog client scripts that will trigger this calculation when the respective value changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:22 AM
Hi Vidya,
Are you using async ajax call? if yes then it will not work. Because it works in background.
You can go through this blog "https://www.servicenow.com/community/developer-articles/async-validation-in-onsubmit-catalog-client-.... It will be helpful for this requirement.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:33 AM
Yes, I am using Ajax call. So is there a work around for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:42 AM - edited 06-04-2024 09:46 AM
You can once check the below link and please the your code in explorer(expect chrome) because expect chrome it is working I have checked just now in my PDI
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0715672
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 09:22 AM
I have tried using the below script it is working me and can you check by modifying the script in the below format
var confirmmessage= confirm("are you going to submit the task");
if(confirmmessage==false){
return false;
}
Thanks and Regards
Sai Venkatesh