Can we override "--None--" value for a dependent choice list?

kushalhora
Kilo Contributor

Hi All,

I have been attempting to override the "--None--" value of a dependent choice list to "--", but unable to do so. I have tried to implement the same by using Choice List table(through NULL_OVERRIDE) and onChange Client Script (through addOption, removeOption), but in vain. Is there a way through which the "--None--" value could be overridden for dependent choice list?

Any solution or suggestions would be highly appreciated.

Thanks!!

1 ACCEPTED SOLUTION
4 REPLIES 4

Thanks Regina!!


Was hoping to arrive at a definite conclusion and the Article surely provided the same.


But, I hope the reported known bug would get resolved soon.


Aleksandr D_
Kilo Expert

Maybe it will useful for someone.
Regarding forms, we can use the g_form class to disappear --None-- in the choice list.

find_real_file.png
We create client script 'on load' where have such code:

// g_form.removeOption('field', '');

find_real_file.png

But in this case with instead --None-- we will have the next 'choice' (next variant in the choice list) in the chosen field ('Email' in my example).
In this situation, we can use script 'on load' where have such code:

// function onLoad() {
// if (g_form.getValue('field') == '') {
// g_form.removeOption('field', '');
// g_form.setValue('field', '');
// } else {
// g_form.removeOption('field', '');
// }
// }

After that, --None-- disappeared and the field will be empty.

find_real_file.png

find_real_file.png

 

You're a genius! Thank you for this