<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> javascript Fuctions </TITLE>
<script language="JavaScript">
function copyCheckboxes(checkbx,priority, active, fDate, tDate){
var idd=document.getElementById(checkbx).id;
if(document.getElementById(checkbx).checked==true){
document.getElementById(priority+idd).disabled=false;
document.getElementById(active+idd).disabled=false;
document.getElementById(fDate+idd).disabled=false;
document.getElementById(tDate+idd).disabled=false;
}else{
document.getElementById(priority+idd).disabled=true;
document.getElementById(active+idd).disabled=true;
document.getElementById(fDate+idd).disabled=true;
document.getElementById(tDate+idd).disabled=true;
}
}
</script>
</HEAD>
<BODY>
<form method="post" action="tbl_row_delete.php" name="rowsDeleteForm">
<table id="table_results" border="0" cellpadding="2" cellspacing="1">
<!-- Results table headers -->
<!-- Results table body -->
<tr >
<td width="16" align="center" valign="top" bgcolor="#D5D5D5"> </td>
<td align="right" valign="top" bgcolor="#D5D5D5" class="nowrap">id</td>
<td valign="top" bgcolor="#D5D5D5">rate</td>
<td valign="top" bgcolor="#D5D5D5">priority</td>
<td valign="top" bgcolor="#D5D5D5">active</td>
<td valign="top" bgcolor="#D5D5D5">from_date</td>
<td valign="top" bgcolor="#D5D5D5">to_date</td>
</tr>
<tr >
<td width="16" align="center" valign="top" bgcolor="#D5D5D5"> <input type="checkbox" id="1" name="rows_to_delete1" onClick="copyCheckboxes(this.id,'priority','active','fromDate','toDate');" />
</td>
<td align="right" valign="top" bgcolor="#D5D5D5" class="nowrap">1</td>
<td valign="top" bgcolor="#D5D5D5">50</td>
<td valign="top" bgcolor="#D5D5D5"><select name="priority[]" id="priority1" disabled>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select></td>
<td valign="top" bgcolor="#D5D5D5"><select name="active[]" id="active1" disabled>
<option value="Y" selected>Y</option>
<option value="N">N</option>
</select></td>
<td valign="top" bgcolor="#D5D5D5"><input name="fromDate[]" type="text" id="fromDate1" value="01-02-2007" size="10" maxlength="10" disabled></td>
<td valign="top" bgcolor="#D5D5D5"><input name="toDate[]" type="text" id="toDate1" value="01-02-2007" size="10" maxlength="10" disabled></td>
</tr>
<tr>
<td width="16" align="center" valign="top" bgcolor="#E5E5E5"> <input type="checkbox" id="3" name="rows_to_delete3" onclick="copyCheckboxes(this.id,'priority','active','fromDate','toDate');"/>
</td>
<td align="right" valign="top" bgcolor="#E5E5E5" class="nowrap">3</td>
<td valign="top" bgcolor="#E5E5E5">50</td>
<td valign="top" bgcolor="#E5E5E5"><select name="priority[]" id="priority3" disabled>
<option value="1">1</option>
<option value="2" selected>2</option>
<option value="3">3</option>
</select></td>
<td valign="top" bgcolor="#E5E5E5"><select name="active[]" id="active3" disabled>
<option value="Y" selected>Y</option>
<option value="N">N</option>
</select></td>
<td valign="top" bgcolor="#E5E5E5"><input name="fromDate[]" type="text" id="fromDate3" value="01-02-2007" size="10" maxlength="10" disabled></td>
<td valign="top" bgcolor="#E5E5E5"><input name="toDate[]" type="text" id="toDate3" value="01-02-2007" size="10" maxlength="10" disabled></td>
</tr>
<tr >
<td width="16" align="center" valign="top" bgcolor="#D5D5D5"> <input type="checkbox" id="4" name="rows_to_delete4" onclick="copyCheckboxes(this.id,'priority','active','fromDate','toDate');"/>
</td>
<td align="right" valign="top" bgcolor="#D5D5D5" class="nowrap">4</td>
<td valign="top" bgcolor="#D5D5D5">10</td>
<td valign="top" bgcolor="#D5D5D5"><select name="priority[]" id="priority4" disabled>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select></td>
<td valign="top" bgcolor="#D5D5D5"><select name="active[]" id="active4" disabled>
<option value="Y" selected>Y</option>
<option value="N">N</option>
</select></td>
<td valign="top" bgcolor="#D5D5D5"><input name="fromDate[]" type="text" id="fromDate4" value="01-02-2007" size="10" maxlength="10" disabled></td>
<td valign="top" bgcolor="#D5D5D5"><input name="toDate[]" type="text" id="toDate4" value="01-02-2007" size="10" maxlength="10" disabled></td>
</tr>
<tr>
<td width="16" align="center" valign="top" bgcolor="#E5E5E5"> <input type="checkbox" id="5" name="rows_to_delete5" onclick="copyCheckboxes(this.id,'priority','active','fromDate','toDate');"/>
</td>
<td align="right" valign="top" bgcolor="#E5E5E5" class="nowrap">5</td>
<td valign="top" bgcolor="#E5E5E5">50</td>
<td valign="top" bgcolor="#E5E5E5"><select name="priority[]" id="priority5" disabled>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select></td>
<td valign="top" bgcolor="#E5E5E5"><select name="active[]" id="active5" disabled>
<option value="Y" selected>Y</option>
<option value="N">N</option>
</select></td>
<td valign="top" bgcolor="#E5E5E5"><input name="fromDate[]" type="text" id="fromDate5" value="01-02-2007" size="10" maxlength="10" disabled></td>
<td valign="top" bgcolor="#E5E5E5"><input name="toDate[]" type="text" id="toDate5" value="01-02-2007" size="10" maxlength="10" disabled></td>
</tr>
</table>
</form>
</BODY>
</HTML>
更多详细信息请参阅http://www.easycodingclub.com/disabled-multiple-input-fields-using-javascript/javascript-tutorials/