codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  how to make an array of button works  luz at 12:59 on Sunday, December 24, 2006
 

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]








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Auto Mail Notification
•  Re: Problems with mkdir
•  how to retrive the values from div tag in my struts action
•  problem related to insert into table.
•  Re: problem in ado.net
•  Chat Server
•  how to make an array of button works
•  where can i download javax.speech package
•  I need your help_ My last exam..help..help.. me...


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007