Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

If No is selected from Yes/No variable, i want the submission to get cancelled

ravikiran0688
Tera Contributor

If No is selected from Yes/No variable, i want the submission to get cancelled

7 REPLIES 7

Hi Rachael,



Is you variable named 'acknowledge' is a checkbox type? If so, please try the below one and please let me know.



function onSubmit() {


      if (g_form.getValue('acknowledge') == 'false')   //Checks if the Acknowledge variable is not checked


              {


              alert("You must agree to the acknowledgement");


              return false;


      }


}



I hope this helps.Please mark correct/helpful based on impact



That did the trick on the checkbox. Thank you!


Sanjeev Kumar1
Kilo Sage

Hi,



You need to write business rules on insert.


and put check if No is selected status should be "Cancelled"