hi,
I have created this program..n i wanna know how 2 update the values frm table.. by clicking update. the values from the table have 2 be displayd in the text field. atleast the name has 2 be displayed...
please give me the code how 2 update....i have give ..document.getElementById('mytable').rows..
but i wanna know how 2 display the values from table in the textfield.. i hope i 'm clear. i have given the code wat i had given.


ramya. K
<html>

<script laguage="JavaScript">
!--
function add(form)
{
var field1=form.name;
var field2=form.radiobutton;
var field3=form.select1;
var field4=form.select2;
var field5=form.select3;
var field6=form.checkbox1;
var field7=form.checkbox2;
var field8=form.checkbox3;
var field9=form.hist;

name=field1.value;
radiobutton=field2.value;
select1=field3.value;
select2=field4.value;
select3=field5.value;
checkbox1=field6.value;
checkbox2=field7.value;
checkbox3=field8.value;
hist=field9.value;

if(name.length==0)
{
alert("Name cannot b left blank")
feild1.focus();
return false;
}
else if(form.checkbox1.checked==false && form.checkbox2.checked==false && form.checkbox3.checked==false )
{
alert("alert click the language")
return false;
}
else if(hist.lenght==0)
{
alert("type some history")
field9.focus();
return false;
}

if(form.checkbox1.checked==true)
{
var t="tamil"
}
else
{
var t=""
}

if(form.checkbox2.checked==true)
{
var e="english"
}
else
{
var e=""
}

if(form.checkbox3.checked==true)
{
var h="hindi"
}
else
{
var h=""
}
var emp=""
var date=form.select1.value
var month=form.select2.value
var yr=form.select3.value
var dob=date+month+yr
var lang=e+emp+t+emp+h



// to insert into the table
var x= document.getElementById('myTable').insertRow(1)
var x1=x.insertCell(0)
var x2=x.insertCell(1)
var x3=x.insertCell(2)
var x4=x.insertCell(3)
var x5=x.insertCell(4)


x1.innerHTML=name
x2.innerHTML=lang
x3.innerHTML=dob
x4.innerHTML=hist
x5.innerHTML="male"
field1.value=" ";
field2.value=" ";
field3.value=" ";
field4.value=" ";
field5.value=" ";
field6.value=" ";
field7.value=" ";
field8.value=" ";
field9.value=" ";
}

function del(i)
{

document.getElementById('myTable').deleteRow(i)
}
function update()
{
var x=document.getElementById('myTable').rows
var y=x[1].cells
y[1].innerHTML=""
y[2].innerHTML=""
y[3].innerHTML=""
y[4].innerHTML=""


}
//-->
</script>
<center>
<form>
<body>NAME
<input type="text" name="name">
</br><br />GENDER :
MALE <input type=radio name=radiobutton value=radiobutton1>
FEMALE <input type=radio name=radiobutton value=radiobutton2>
<br /><br>DOB <select name=select1>
<option value="jan">jan</option>
<option value="feb">feb</option>
<option value="march">march</option>
<option value="april">april</option>
<option value="may">may</option>
<option value="jun">jun</option>
</select>
<select name=select2>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
<select name=select3>
<option value="1991">1991</option>
<option value="feb">1992</option>
<option value="march">1993</option>
<option value="april">1994</option>
<option value="may">1995</option>
<option value="jun">1996</option>
</select></br></br>
LAGUAGE :
English<input type=checkbox name=checkbox1 value=checkbox>
Tamil<input type=checkbox name=checkbox2 value=checkbox>
Hindi<input type=checkbox name=checkbox3 value=checkbox></br></br>

HISTORY
<textarea name=hist rows=5></textarea>

<br /></br>
<button onclick=add(form);>ADD</button>
<button onclick=del(1);>DELETE</button>
<button onclick=update();>UPDATE</button></body>
</br></br>
<table id="myTable" border="1">
<b>
<tr>
<td>NAME</td>
<td>LANGUAGE</td>
<td>DOB</td>
<td>HISTORY</td>
<td>GENDER</td>

</tr>
</b>
</table>
</form>

</center>
</html>