javascript show hide error
victorpJul 11 2006 — edited Oct 15 2006Based on a value from my radio group, I want to either show or hide a text item. Against the radio group in the HTML Form Elements Attributes I have put<br><br>
onchange="fn_showhide(this)"
<br><br>
in my .js file I have added the following function<br><br>
function fn_showhide(itemtohide)<br>
{<br>
<br>
var item1 = document.getElementById(itemtohide).value;<br>
var el=html_GetElement(itemtohide);<br>
<br>
if (item1=='SA'){<br>
html_HideElement(el); <br>
}else{<br>
html_ShowElement(el);<br>
};<br>
}<br>
<br>
when i change the radio I get a page error (javascript) and it is something like syntax error, object expected. can anyone spot where I have gone wrong? I have looked at other examples in the forum and they look very similar so can't figure it out. thanks