|
Hello everybody....i really a need some help with this js here...well my page is like the code and pic below,as you all can see, its contain name,department and active column.The active column contain 2 button which is yes and no.What i want to do is....let say for example if the yes button on first row is click its become disabled and no button become active.The action of these 2 button will generate a value for HiddenField(activeval).I will like to apply the same action to the other rows as well respectively.I'm going to used this js with php generated page...thanking u all in advance for your time in reviewing my msg...may god bless u all.
[CODE]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function clickyes(){
document.getElementById('b1').disabled=true;
document.getElementById('b2').disabled=false;
document.getElementById('activeval').value="yes";
}
function clickno(){
document.getElementById('b1').disabled=false;
document.getElementById('b2').disabled=true;
document.getElementById('activeval').value="no";
}
</script>
</head>
<body>
<table width="368">
<tr>
<td width="115" bgcolor="#999999">Name</td>
<td width="149" bgcolor="#ADADAD">Department</td>
<td width="88" bgcolor="#D2D2D2">Active</td>
</tr>
<tr>
<td bgcolor="#999999">Jamie</td>
<td bgcolor="#ADADAD">Coperate</td>
<td bgcolor="#D2D2D2"><input type="button" name="set1" id="b1" onclick="clickyes()" value="yes"/>
<input type="button" name="set12" id="b2" onclick="clickno()" value="no"/>
<input name="activeval" type="hidden" id="activeval" /></td>
</tr>
<tr>
<td bgcolor="#999999">Emily</td>
<td bgcolor="#ADADAD">Finance</td>
<td bgcolor="#D2D2D2"><input type="button" name="set1" id="b1" onclick="clickyes()" value="yes"/>
<input type="button" name="set12" id="b2" onclick="clickno()" value="no"/>
<input name="activeval" type="hidden" id="activeval" /></td>
</tr>
<tr>
<td bgcolor="#999999">Jamie</td>
<td bgcolor="#ADADAD">Human Resource </td>
<td bgcolor="#D2D2D2"><input type="button" name="set1" id="b1" onclick="clickyes()" value="yes"/>
<input type="button" name="set12" id="b2" onclick="clickno()" value="no"/>
<input name="activeval" type="hidden" id="activeval" /></td>
</tr>
<tr>
<td bgcolor="#999999">Oliver</td>
<td bgcolor="#ADADAD">It</td>
<td bgcolor="#D2D2D2"><input type="button" name="set1" id="b1" onclick="clickyes()" value="yes"/>
<input type="button" name="set12" id="b2" onclick="clickno()" value="no"/>
<input name="activeval" type="hidden" id="activeval" /></td>
</tr>
</table>
</body>
</html>
[/CODE]
|
|
|
|
|
|
|
|