Client Script detect if value of field is --None--
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2019 12:42 PM
I have a client script where if Field A is yes, I want Field B to change its value and if Field A is no or the default --None-- then I want Field B to change back to its original state. I can't get the script to detect if Field A is --None--. It works fine if Field A is Yes or No. I have tried just doing a blanket "else" statement and detecting if(Field A == '') but neither of those work.
My script is:
if(g_form.getValue('Field A' == 'yes'){
g_form.setValue('Field B', 'yes')
}
else{
g_form.setValue('Field B', 'no')
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2019 05:38 AM
Unfortunately I need this to be an On Change script, as I need this to update as they fill out the form, not when they submit the form.