- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 02:44 AM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 03:05 AM
And if you find this too tiring, then just create a ui policy and there you can use the condition builder to select none for field regardless of the value...and use 'execute if true' to run whatever you wanted to run

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 02:59 AM
in your script if you want to check then just
try with script below.
if(g_form.getValue('category')=='') //change the field name
{
alert('hello');
}
else
{
alert('not hellow');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2018 03:17 AM
Unless otherwise defined it is blank. If it is returning a value you may want to check if it is defined in the choices of the dictionary.
If it is blank you may want to look at the Client script. If you are looking to take action on - None - ensure you remove "|| newValue === ''" from the initial if statement in the client script.
See Example Below
// Client script is ended if the value is blank
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
// Code here WILL NOT execute on - None -
}
// Client script is not ended if the value is blank
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
// Removed so that script continues on - None -
if (isLoading /*|| newValue === ''*/) {
return;
}
// Code here WILL execute on - None -
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2025 01:09 AM - edited ‎01-10-2025 01:12 AM
@dianemiro
You should use the 'addOption()' method like below
g_form.addOption(<fieldName>, <choiceValue>, <choiceLabel>) // example given below
g_form.addOption('support_needed', '', '-- None --');
g_form.addOption('support_needed', 'amazon', 'Amazon Prime');
This will work even if we have Mandatory check for the 'support_needed' making it mandatory even if we toggle between the options(without this way, the first option will be selected while you toggle between the options)
if (platform_selected == 'ott'){
g_form.addOption('support_needed', '', '-- None --');
g_form.addOption('support_needed', 'amazon', 'Amazon prime');
}else{
g_form.addOption('support_needed', '', '-- None --');
g_form.addOption('support_needed', 'national_geograpthy_tv', 'National Geography TV');
}
The blank value should be used in the above way.
Thanks,
- Rohan