Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to popup message or alert on Servicenow portal for Quantity drop-down field ?

Virendra K
Kilo Sage

Hi All,

I want to popup a message /alert if user is selecting more than 8 quantity in the below drop down field(snap 1). 

Do I need to do the coding in HTML template or Client script or Server script ?  I have find coding part for this field in HTML template (snap2)

Please let me know how I can popup message and stop user to select more than 8 number /qty ? 

Snap1:

find_real_file.png

 

Snap2:

find_real_file.png

 

Thank you.

Regards,

Virendra

 

 

12 REPLIES 12

Hello:

I have a similar requirement and have copied your catalog client script and set isolate script to false. Unfortunately the line below does not return the quantity.  Is there anything else I must do? Thank you.  

var quantity = $j('#quantity').val();

Hi,

Any error in browser console?

Regards
Ankur

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

Yes, when I click Add to Cart I receive the error is "There is a JavaScript error in your browser code."

I've taken a screen shot of the catalog client script, below in case that points to anything I am doing wrong.  I know your post said "Note: this includes using DOM manipulation", I am new to working with the catalog and don't know if I need to do anything regarding the DOM.  I am using the Orlando version.  Thank you for any help. Christine

 

find_real_file.png

Hi,

I haven't tried it recently.

But what is the browser console error; please check that

Regards
Ankur

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

Here is the error message, which is followed by a warning message. Thank you.

 

find_real_file.png