- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2012 06:34 PM
There is a feature available to change the display value of the "-- None --" option in Select Box fields on forms. Here's the Wiki article - http://wiki.service-now.com/index.php?title=Customizing_Choice_Lists#Changing_the_--_None_--_Display_Value
However, that does not work with Catalog Variables. I created a UI Script that does it for you:
function u_replaceSelectBoxNoneString(variableName, newString) {
try{
var control = g_form.getControl(variableName);
control.options[0].text = newString;
}
catch(err) {}
}
So now you can just call it from an onLoad script to change the string:
function onLoad() {
u_replaceSelectBoxNoneString('action', '-- Please Select --');
}
and you end up with:
Bonus - It actually works on forms as well.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2014 01:10 PM
Just setting this answer as correct as the actual thread was not meant as a question and it cannot be changed because it came from the original Community site.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2019 04:18 AM
Or, you can go to "Type Specifications" and uncheck "Include none".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2019 12:19 PM
Hi Jim,
That's the article I was looking for, I had a similar requirement in my project need you help.
writing the below as UI Script
replaced variable name with name of the variable where --None-- need to be replaced.
Having a doubt what else needs to be changed to make this work.
function u_replaceSelectBoxNoneString(variableName, newString) {
try{
var control = g_form.getControl(variableName);
control.options[0].text = newString;
}
catch(err) {}
}
writing the below onLoad catalog Client script in Catalog Item
function onLoad() {
u_replaceSelectBoxNoneString('action', '-- Please Select --');
}