OnSubmit client script is not working on Order guide

venkateshdhanap
Tera Contributor

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

5 REPLIES 5

Thank you so much Faizi