Hi @Kruthik M Shiva 

Add one more line "return false" to the bottom of the client script. It should work

function onSubmit() {

    /*** Pop this gem into your script! */
    if (g_scratchpad.isFormValid) {
        return true;
    }
    var actionName = g_form.getActionName();

    var ga = new GlideAjax('x_intellectu.CheckRetired');
    ga.addParam('sysparm_name', 'CheckingRetired');
    ga.addParam('sysparm_ia_name', g_form.getValue('ia_name'));
    ga.getXML(RetiredCheck);

    function RetiredCheck(response) {
        var answer = response.responseXML.documentElement.getAttribute("answer");
        if (answer == 'true') {
            alert('This is retired');
            return false;
        }
        /*** Pop this gem into your script! */
        g_scratchpad.isFormValid = true;
        g_form.submit(actionName);
    }
	/*** Pop this gem into your script! */
	return false;
}

 

Cheers,

Tai Vu

View solution in original post