The value of dropdown --None--

alexcharleswort
Tera Expert

Seems like a rudimentary question. I am writing an onSubmit client script. I want it to say something like if choice_1 is --None-- set order_1 to xxx. What is the value behind --None-- that I can use in my script? I've tried null, Null, NULL, none, None, --None--, -- None --. I have tried reading both the value and the displayValue and I can't seem to get the right one.

Any help would be sincerely appreciated. Thanks in advance!

1 ACCEPTED SOLUTION

chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Alex,



It's blank.


View solution in original post

6 REPLIES 6

chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Alex,



It's blank.


Oh my gosh... yup, that helped tremendously. Thank you!!!


I do agree that it is blank, but that does not solve the problem. The following code does not get executed when None is selected

default:
    g_form.clearOptions('profiles');
    g_form.addOption('profiles', '', '-- None --');

OR

case '':
    g_form.clearOptions('profiles');
    g_form.addOption('profiles', '', '-- None --');

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Alex,



Try as


if(g_form.getValue('PASS FIELD NAME') == '')


{


//your code


}