Hi, I have a javascript which works fine with FF & IE8 but in IE 7 it fails. Can some one help me understand where this all is going wrong? I am not javascript expert but just manage to write some code after learning through tutorials on the net.
Here is the javascript code -
HideShowSqr is called by radio change event in the form-
Rows that need to be hidden/shown are coded like this-
Can someone tell me how I can get this working in IE 7 please? Your help is much appreciated.
Here is the javascript code -
Code:
function HideShowSqr(val,thisname)
{
select_value = val.value;
var trs=document.getElementsByTagName('TR');
for (i=0;i<trs.length;i++){
if(trs[i].getAttribute(thisname)){
if((trs[i].getAttribute(thisname) == 'sqr')){
if( select_value == 'no'){
trs[i].style.display = 'none';
}
else{
trs[i].style.display = 'table-row';
}
}
}
}
}
HideShowSqr is called by radio change event in the form-
Code:
<input type="radio" value="yes" name="sun_quote_ref" id="sun_quote_ref" onClick="HideShowSqr(this,'sqr');"> Yes <input type="radio" value="no" name="sun_quote_ref" id="sun_quote_ref" onClick="HideShowSqr(this,'sqr');"> No
Code:
<tr id="hide1" sqr="sqr"> <td class="columncaption" style="text-align: right;" valign="top"><div class="pad5x10">Configuration Cart:</td> <td class="yellow1"><div class="pad5x10"><input type="text" name="Configuration_Cart" id="Configuration_Cart" value="" size="40"></td></tr> <tr id="hide1" sqr="sqr"> <td class="columncaption" style="text-align: right;" valign="top"><div class="pad5x10">Quote Reference:</td> <td class="yellow1"><div class="pad5x10"><input type="text" name="Sun_Quote_Reference" id="Quote_Reference" value="" size="40"></td></tr>
Comment