I need pop message on catalog item when click o the submit the form

Siva82
Tera Expert

Hi,

I need pop message on catalog item like " Please refer to the links for standard firewall service request . Hence request cannot be submitted." and this not summitted.This page just stay same page and  just pop the msg on the top of the page.

Thank you.

1 ACCEPTED SOLUTION

Hi,

then do this

function onSubmit() {

	// give variable name and the correct choice value
	if(g_form.getValue('variableName') == 'global'){
		alert('Please refer to the links for standard firewall service request. Hence request cannot be submitted.');
		//Abort the submission
		return false;
	}

}

Regards
Ankur

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

View solution in original post

8 REPLIES 8

Prasad Dhumal
Mega Sage
Mega Sage

Hello Siva

you can use OnSubmit catalog client script.

to add pop message, you can use alert. and use return false so item will not get submit.

function onSubmit() {
   
      alert('Please refer to the links for standard firewall service request . Hence request cannot be submitted.');

      //Abort the submission
      return false;
   
}

Hi prasad,

Thank you for fast reply and helping on my query,

Its helpful, But I have small change on my requirement.

I have one variable("Please select the type of firewall change required")  on  my catalog item ",

For this varible having 2 choice :- 1. standard

                                                 2.  Global

I want work this functionality on for 2. Global choice.

Please refer the attachment for reference. 

Can u please help on this. 

 

find_real_file.png

Murthy Ch
Giga Sage

@Siva

You can use onSubmit() client script here and use below logic:

alert('Your text here');
return false; //use this to restrict the submission of the form
Thanks,
Murthy

Hi Siva,

Add one more if statement:

function onSubmit() {
if(g_form.getValue('variable_name')=='Value') //Map Please select the type of firewall change required variable name here
      alert('Please refer to the links for standard firewall service request . Hence request cannot be submitted.');

      //Abort the submission
      return false;
   
}

Hope it helps

Thanks

Murthy

Thanks,
Murthy