onChange script not working for --None-- value

R10
Tera Contributor

I have a field of type String  with Choice type "Dropdown with --None--". While changing the field value the onChange client script is triggering but when I am changing value to --None-- the onChange client script is not getting triggered. Is there any other way to do some operation while the dropdown value is getting changed to --None-- ?

2 ACCEPTED SOLUTIONS

DrewW
Mega Sage
Mega Sage

The value for "--None--" is an empty string.  So without seeing your code I would say that you probably have the default script there and it just returns when the newValue is empty so you need to probably take that check out.

View solution in original post

Michael James2
Tera Expert

OnChange Client Scripts typically have the boilerplate code added that exits the script when the field is blank. You should just have to simply remove the "newValue === '' from the if statement and the script will execute when the field is blank or None.

MichaelJames2_0-1675971456577.png

 

View solution in original post

6 REPLIES 6

DrewW
Mega Sage
Mega Sage

The value for "--None--" is an empty string.  So without seeing your code I would say that you probably have the default script there and it just returns when the newValue is empty so you need to probably take that check out.

Michael James2
Tera Expert

OnChange Client Scripts typically have the boilerplate code added that exits the script when the field is blank. You should just have to simply remove the "newValue === '' from the if statement and the script will execute when the field is blank or None.

MichaelJames2_0-1675971456577.png

 

thanks so much - this helped me as well. 

Thank you, @Michael James2.