hi, not sure why both IF’s execute… try out this code, and let me know what you think … thanks !!
<HTML>
<HEAD>
<SCRIPT language=”javascript”>
function activator(row) {
var id = new String();
var sVal = new String();
id = “t_active” + row;
var oObj = document.getElementById(id);
var sVal = oObj.value;
alert(sVal);
if (sVal=”N”) {
alert(“disable”);
id = “t_act” + row;
var oTd = document.getElementById(id);
oTd.disabled = true;
id = “t_rpt” + row;
var oSel = document.getElementById(id);
oSel.disabled = true;
}
else if (sVal=”Y”) {
alert(“enable”);
id = “t_act” + row;
var oTd = document.getElementById(id);
oTd.disabled = false;
id = “t_rpt” + row;
var oSel = document.getElementById(id);
oSel.disabled = false;
}
}
function onsave() {
var len = document.forms[0].elements.length;
for (var i=1; i <= len; i++) {
if ( document.forms[0].elements[i] != null ) {
document.forms[0].elements[i].disabled = false;
}
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name=form1 action=”” method=”post”>
<TABLE border=0 cellPadding=4 cellSpacing=0 width=”80%” align=center>
<TR><TD>Advertiser</TD>
<TD>Subscribe?</TD>
<TD>Variable1</TD>
<TD>Variable2</TD>
</TR>
<TR>
<TD>adv1</TD>
<TD>
<select name=”t_active” id=”t_active1″ onchange=”activator(1);”>
<option value=”Y”>Yes</option>
<option value=”N”>No</option>
</select>
</TD>
<TD><INPUT type=text name=t_rpt id=”t_rpt1″ value=”this is t_rpt1″></TD>
<TD><INPUT type=text name=t_act id=”t_act1″ value=”this is t_act1″></TD>
</TABLE>
<BR><BR><BR>
<center>
<INPUT name=cmdsave class=”sbutton” type=button value=”Reset” onClick=”onsave();”>
</FORM>
</BODY>
</HTML>