OnSubmit client script is not working on Order guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:47 AM
Hi All,
I having Order guide with 3 catalog item.I have written onsubmit client script for one of the item.
I need to avoid form submission based on one condition.Condition also matching and alert message also throwing but form gets submiitted.
Its working fine in seprate catalog item but issue when submits from order guide.
Should I need to write script n Order guide as well?
If yes means how should get variables of particular item inside order guides script?
This script written on the item not on order guide:
function onSubmit() {
var fname=g_form.getValue('first_name');
var surname=g_form.getValue('surname');
var manager=g_form.getValue('user_line_managers');
var ga = new GlideAjax('WOWUtilsAJAX');
ga.addParam("sysparm_name","CheckDuplicateUser");
ga.addParam('sysparm_fname',fname);
ga.addParam('sysparm_surname',surname);
ga.addParam('sysparm_manager',manager);
ga.getXML(Check);
function Check(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer=='true'){
alert('A duplicate user has been found in SWOW. Are you sure you want to continue with this request?');
return false;
}
}
}
Thanks
Venkatesh Dhanapal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 03:57 AM
Thank you so much Faizi