Hide-when in web form based on the value of the field

Hello All,

I have a web form & have a field 1 called BA & field 2 SO. The field SO needs to be hidden for all the values selected in BA except the value other.

Confused where to use the Javascript in order for it to work. In OnLoad event I have the following code

frm.Tx_SO.visible = false;

In OnBlur event of BA field I have the following code:

If (window.document.forms[0].Tx_BA ==‘Other’)

{window.document.forms[0].Tx_SO.Visible = true;

}

else

{window.document.forms[0].Tx_SO.Visible = false;

}

It does not work.

Please let me know if you have any suggestions. Thanks in advance.

Subject: Hide-when in web form based on the value of the field

javascript is case sensitive, try changing your If to if.

Subject: RE: Hide-when in web form based on the value of the field

Thank you for your response. It gives me runtime error object do not support this method or object.Please let me know if you have any suggestions thanks in advance.

Subject: RE: Hide-when in web form based on the value of the field

In the HTML tab of the SO fields properties put: idSO.In the onChange event of the BA field put:

objSO = document.getElementById(“idSO”);

if (document.forms[0].BA.value == “Other”) {

objSO.style.display="block"

}else {

objSO.style.display="none"

}

Subject: RE: Hide-when in web form based on the value of the field

Thanks it kind of worked & did not work. It worked when I select the value other in BA field the SO field is hidden and when I change it back to a different value it would not unhide. I want to hide as soon as the form is opened because the value would not be other. So I reverse it to be none when the value is other and it did not work.

Please let me know any suggestions. Thanks in advance.

Subject: RE: Hide-when in web form based on the value of the field

put the same code into the onload event. Or better yet, set set it up as a function in the jsheaderfunction showhide () {

objSO = document.getElementById("idSO");

if (document.forms[0].BA.value == "Other") {

    objSO.style.display="block"

}else {

    objSO.style.display="none"

}

}

and then simply put the function call into the form onload event and field onchange event: showhide();

as to why it wont unhide, check your code. Javascript is case sensitive, so is probably something like that that is wrong