I'm in the process of converting some vBScript to JavaScript and having some problems. I have a table with two rows with ids trBusiness and trHome. I also have two input fiels of type radio. Depending of which of these inputs is chosen I want to prevent trBusiness or trHome from being displayed. I did this in VBScript by doing the following:<br>
<br>
// if Businss is chosen <br>
sub clkBus()<br>
document.all.trBusiness.style.display = ""<br>
document.all.trHome.style.display = "none"<br>
end sub<br>
<br>
// if Home is chosen<br>
sub clkRes()<br>
document.all.trBusiness.style.display = "none"<br>
document.all.trHome.style.display = ""<br>
end sub<br>
<br>
I thought that I could use the same syntax (document.all.trBusiness.style.display = "none") in JavaScript accomplish the same task. But when I view it in the browser (I've tried both IE 4 and Navigator 4.6) it "bombs" at this line. How would I go about preventing a row from being displayed in javascript? Is my syntax wrong?<br>
<br>
// if Businss is chosen <br>
sub clkBus()<br>
document.all.trBusiness.style.display = ""<br>
document.all.trHome.style.display = "none"<br>
end sub<br>
<br>
// if Home is chosen<br>
sub clkRes()<br>
document.all.trBusiness.style.display = "none"<br>
document.all.trHome.style.display = ""<br>
end sub<br>
<br>
I thought that I could use the same syntax (document.all.trBusiness.style.display = "none") in JavaScript accomplish the same task. But when I view it in the browser (I've tried both IE 4 and Navigator 4.6) it "bombs" at this line. How would I go about preventing a row from being displayed in javascript? Is my syntax wrong?<br>