你为什么总是给残缺的代码呢?<script>
function jaNee(obj) {
var sele = document.properties_form[obj.name];
for(var i=0; i<sele.length; i++) {
if(sele[i] == obj) break;
}
if(obj.selectedIndex == "2") {
document.properties_form['startValue[]'][i].disabled = true;
document.properties_form['endValue[]'][i].disabled = true;
alert("you select second option");
}
if(obj.selectedIndex != "2") {
document.properties_form['startValue[]'][i].disabled = false;
document.properties_form['endValue[]'][i].disabled = false;
alert("you select others");
}
}
</script>
<table>
<form name='properties_form'>
<?php
for ($i = 0; $i<4; $i++)
{?>
<TR>
<TD ALIGN=CENTER><INPUT TYPE="text" NAME="propertyName[]"SIZE="50"></TD>
<TD ALIGN=CENTER>
<SELECT ID="iName" NAME="itemName[]" onchange="jaNee(this)">
<OPTION VALUE="SEC">SEC</OPTION>
<OPTION VALUE="NumToNum">NumToNum</OPTION>
<OPTION VALUE="Ja\Nee">Ja\Nee</OPTION>
</SELECT>
</TD>
</TD><TD ALIGN=CENTER><INPUT TYPE="text" ID="startValue" NAME="startValue[]" SIZE="8"></TD>
<TD ALIGN=CENTER><INPUT TYPE="text" ID="endValue" NAME="endValue[]" SIZE="8" ></TD>
</TR>
<?php }?>
</form>
</table>
function jaNee(obj) {
var sele = document.properties_form[obj.name];
for(var i=0; i<sele.length; i++) {
if(sele[i] == obj) break;
}
if(obj.selectedIndex == "2") {
document.properties_form['startValue[]'][i].disabled = true;
document.properties_form['endValue[]'][i].disabled = true;
alert("you select second option");
}
if(obj.selectedIndex != "2") {
document.properties_form['startValue[]'][i].disabled = false;
document.properties_form['endValue[]'][i].disabled = false;
alert("you select others");
}
}
</script>
<table>
<form name='properties_form'>
<?php
for ($i = 0; $i<4; $i++)
{?>
<TR>
<TD ALIGN=CENTER><INPUT TYPE="text" NAME="propertyName[]"SIZE="50"></TD>
<TD ALIGN=CENTER>
<SELECT ID="iName" NAME="itemName[]" onchange="jaNee(this)">
<OPTION VALUE="SEC">SEC</OPTION>
<OPTION VALUE="NumToNum">NumToNum</OPTION>
<OPTION VALUE="Ja\Nee">Ja\Nee</OPTION>
</SELECT>
</TD>
</TD><TD ALIGN=CENTER><INPUT TYPE="text" ID="startValue" NAME="startValue[]" SIZE="8"></TD>
<TD ALIGN=CENTER><INPUT TYPE="text" ID="endValue" NAME="endValue[]" SIZE="8" ></TD>
</TR>
<?php }?>
</form>
</table>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货