- Thu Oct 01, 2015 5:32 pm
#784067
My goal is in a Dynaform to make a drop down with "Yes" and "No" to make a text box appear when the user selects "Yes" and disappear if the user selects "No". The drop down id is userApproval and the text box id is userName. I am currently trying to do this by writing it in java script in the Dynaform, my code is below. Currently it cannot find the id userApproval and I do not know why. Any help would greatly appreciated.
Code: Select all
function showOrHideAddress() {
if ($("#userApproval").getValue == "1") {
$("#userName").show; //show Address field
}
else {
$("#userName").hide; //hide Address field
}
}
$("#userApproval")[0].onchange = showOrHideAddress; //execute when user selects an option
showOrHideAddress(); //execute when DynaForm loads
// $("#userName").hide()