return false; not working in on change Client script

Ganesh K_
Kilo Contributor
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    if (g_scratchpad.x == '5 year') {
        var answer = confirm(" are you sure to change long term holding ");
        if (answer == true) {
            g_form.addInfoMessage("long term holding changes to " + newValue);
        } else {
            return false;
        }
    }

}
6 REPLIES 6

Chandra Sekhar6
Tera Guru

Hi,

 

return false; will work on onSubmit client script type not on onChange or onLoad.

As onChange is not like submitting the record/form

@Chandra Sekhar Maganty Please do not duplicate the answer as the same point has been already mentioned above by me.

Hope this makes sense Chandra!!

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke