nikko50
01-01-2011, 09:17 PM
I'm trying to highlight the row color when the input field is changed but get an error. Can someone please help. TRACY:(
<script type="text/javascript">
function toggle(trid){
var edited_row_bgcolor = '#FAEBD7';
var elm = document.getElementById(trid);
document.elm.style.background = edited_row_bgcolor;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr id="Child1">
<td width="50%">
<input onchange="toggle('Child1');" type="text" name="T1" size="20">
</td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
</table>
<script type="text/javascript">
function toggle(trid){
var edited_row_bgcolor = '#FAEBD7';
var elm = document.getElementById(trid);
document.elm.style.background = edited_row_bgcolor;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr id="Child1">
<td width="50%">
<input onchange="toggle('Child1');" type="text" name="T1" size="20">
</td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><input type="text" name="T1" size="20"></td>
<td width="50%"></td>
</tr>
</table>