What is the value of -- None -- in select box?

dianemiro
Kilo Sage

Hi Everyone,

I know before that the value of -- None -- in select box is blank or ''. I am creating a client script to clear selections if -- None -- is selected in a select box but I can't get it to work. It seems that the value of -- None -- is not '' or blank. Can you help me to confirm what is the value of None?

Thank you,
Diane

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

it's actually blank 

View solution in original post

8 REPLIES 8

Harsh Vardhan
Giga Patron

it's actually blank 

I'm using switch/case in a client script, and neither default nor case: "" detect the change to -- None -- from  another selection.  I'm trying to clear another field if it's selected, and no go.  The other selections are read fine...

 

EDIT: oops!  forgot to remove "|| newValue === ''"

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Diane,

If the None option is because of Dropdown with none then it should be empty.

Can you share the script here?

Regards

Ankur

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

Anurag Tripathi
Mega Patron
Mega Patron

--None-- is blank. 

 

You can select none on the form and use javascript executor to check if it different(ctrl+alt+shift+j...then run alert(g_form.getValue('<field name>')))

 

-Anurag