yes or no
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 05:50 AM
How to auto populate yes or no question type based on another variable by using client script
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 10:36 PM
You can write an On-Change client script which can make the value of your first field to Yes or No based on the change of value in your second field. Below is a sample code and snip of the client script for your reference :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
// Assuming write_yes_or_no is a text field on change of which Yes or No dropdown value should change
var yesOrNo = g_form.getValue('write_yes_or_no');
yesOrNo = yesOrNo.toLowerCase();
if(yesOrNo == "yes"){
g_form.setValue('yesorno','Yes');
}
else if(yesOrNo == "no"){
g_form.setValue('yesorno','No');
}
}
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.