On Change Client form Remove option not working Dynamically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 01:03 PM
Hi all,
I have a simple requirement , but not working as expected .
As per two fields , i have to remove a option
Field 1 : IF u_os_install_required is NO
Field 2 : OR IF u_os_installation_team is "BELLMAWR" or "CUSTOMER" .
FIELD 3 : u_database_installation_team - REMOVE THE OPTION "PPS"
This is working as expected .
BUT before submitting, if they change their mind and want to make changes . It is not making the changes .
Also tried form getValue(), this method is not working too .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 01:17 PM
Hi Kristina!
This is the way Client Scripts work.
Once the value is removed from the form, it will stay like that unless the form is reloaded or added back.
You can use an add to your conditional and re-add the Option with g_form.addOption.
Hope that helps!
If it did, please mark as Helpful and consider setting this reply as the Correct Answer to the question, thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 01:20 PM
You will have to add code that re-adds that option after you delete it. The user will see this value again if they refresh the page though. Normally when I do remove options with If statements, I add an "else" that re-adds the option to the form. Such as:
if(newValue != 'value') {
g_form.removeOption('field', 'value';
} else {
g_form.addOption('field', 'value')
}
Please mark this as correct/helpful if it answered your question!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 01:23 PM
Hi,
I think you should control how the user returns to the 'zero' state in the form and the behaviour of the choice options, it should be something like this:
if(newValue === 'no') {
g_form.removeOption('u_database_installation_team','PPS-TIE Infrastucture team');
}else{
g_form.addOption('u_database_installation_team','PPS-TIE Infrastucture team');
}
If t was helpful, please give some positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 06:17 PM
Guys ,
I have already tried the If else part , it doesn't work . And it doesn't work without a reload