How to disable the submit button in the catalog form if the variable choice option is Disagree

Sanjay E
Kilo Contributor

How to disable the submit button in the catalog form if the variable choice option is selected as Disagree

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sanjay E 

Why not use onSubmit catalog client script and if the variable is Disagree stop form submission

function onSubmit(){

	if(g_form.getValue('variable') == 'Disagree'){
		alert('Not allowed');
		return false;
	}

}

you need to write onChange catalog client script on that variable

Show/hide the button using DOM

Note: DOM is not recommended approach

check this link for help

Show/Hide Submit button on Catalog Item

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

15 REPLIES 15

Timothy F1
Tera Guru

We make use of this method, but are hoping for an improvement out of the box: View Idea Page - ServiceNow Community