V
Vinikz
Hi,
I am new to javascript. I did one program for fetch table row values
to text box. But i can fetch only first row . Here iam attaching
my code. Please help me.....
<html>
<head>
<script>
function swap(){
document.getElementById('s2').value=document.getElementById('text1').innerHTML;
document.getElementById('s3').value=
document.getElementById('text2').innerHTML;
}
</script>
</head>
<body>
<table>
<tr>
<td>
<input type="radio" onClick="swap()">
<a id="text1" name="text1" >sunil</a>
<a id="text2" name="text2" >dibhu</a></td>
</tr>
<tr>
<td>
<input type="radio" onClick="swap()">
<a id="text1" name="text1" >shijin</a>
<a id="text2" name="text2" >vneeth</a>
</td>
</tr>
<tr>
<td>
<input type="text" id="s2" name="s2" >
</td>
<td>
<input type="text" id="s3" name="s3" >
</td>
</tr>
</table>
</body>
</html>
I am new to javascript. I did one program for fetch table row values
to text box. But i can fetch only first row . Here iam attaching
my code. Please help me.....
<html>
<head>
<script>
function swap(){
document.getElementById('s2').value=document.getElementById('text1').innerHTML;
document.getElementById('s3').value=
document.getElementById('text2').innerHTML;
}
</script>
</head>
<body>
<table>
<tr>
<td>
<input type="radio" onClick="swap()">
<a id="text1" name="text1" >sunil</a>
<a id="text2" name="text2" >dibhu</a></td>
</tr>
<tr>
<td>
<input type="radio" onClick="swap()">
<a id="text1" name="text1" >shijin</a>
<a id="text2" name="text2" >vneeth</a>
</td>
</tr>
<tr>
<td>
<input type="text" id="s2" name="s2" >
</td>
<td>
<input type="text" id="s3" name="s3" >
</td>
</tr>
</table>
</body>
</html>