- Sun Aug 18, 2019 4:14 pm
#826035
Hi,
I write a javascript code in order to make dependent fields in dynaform. but there is a mistake. at the first time, when the user select "No" the "Reasons for disagreement" appears and it's ok.
but when the user select "Yes" and after that (before submit) select "No" the "Reasons for disagreement" and "description" appear!! while the "description" is related to "Yes" selection. json file is attached. this is javascript code:
I write a javascript code in order to make dependent fields in dynaform. but there is a mistake. at the first time, when the user select "No" the "Reasons for disagreement" appears and it's ok.
but when the user select "Yes" and after that (before submit) select "No" the "Reasons for disagreement" and "description" appear!! while the "description" is related to "Yes" selection. json file is attached. this is javascript code:
Code: Select all
thanks.$("#action_not_approve_description").hide(); //Hide when the form loads
$("#action_teams").hide();
$("#action_plan_draft").hide();
$("#action_approve_description").hide();
$("#action_approve").setOnchange( function(newVal, oldVal) {
$("#action_not_approve_description").hide();
$("#action_teams").hide();
$("action_approve_description").hide();
$("#action_plan_draft").hide();
if (newVal == "1") {
$("#action_teams").show();
$("#action_approve_description").show();
$("#action_plan_draft").show();
}
if (newVal == "0") {
$("#action_not_approve_description").show();
}
});