4
4Ankit
hello all, i am having some difficulty retrieving information from my
form. I want to add content in my table but the content i want to add
to the table is what the user inputs in my form.
Basically i want to know how i retrieve information from the form so i
can disaply it in the table.
i have put the code i am using below, the feature i cannot get to work
is the change content function. I want the email address entered by
the user,if the change content button is clicked it copies the email
address in the the top of the table.
Below is the code i am using:
<html>
<head>
<title>retrieve information from form </title>
<script type="text/javascript">
function changeContent()
{
var x=document.getElementById('myTable').rows[0].cells
x[1].innerHTML=document.getElementById('test.emailaddress')
}
</script>
<style type="text/css">
strong {font-weight:bolder;
color: powder blue;
font-style:Minion;
font-size:50%};
</style>
<head>
<body>
<h1> Worldcup Groups <h1>
<table id="myTable" border="1">
<tr>
<td>Game1</td>
<td>India</td>
</tr>
<tr>
<td>Game2</td>
<td>Pakistan</td>
</tr>
<tr>
<td>Game3</td>
<td>Sri Lanka</td>
</tr>
</table>
<formname = "test">
<p>
<label>Email Address:
<input type = "text"value="e.g. (e-mail address removed)" name =
"emailaddress" size = "35" maxlength=
"35"/>
</label>
</P>
<input type="button" onclick="changeContent()" value="Change content">
</form>
</body>
</html>
form. I want to add content in my table but the content i want to add
to the table is what the user inputs in my form.
Basically i want to know how i retrieve information from the form so i
can disaply it in the table.
i have put the code i am using below, the feature i cannot get to work
is the change content function. I want the email address entered by
the user,if the change content button is clicked it copies the email
address in the the top of the table.
Below is the code i am using:
<html>
<head>
<title>retrieve information from form </title>
<script type="text/javascript">
function changeContent()
{
var x=document.getElementById('myTable').rows[0].cells
x[1].innerHTML=document.getElementById('test.emailaddress')
}
</script>
<style type="text/css">
strong {font-weight:bolder;
color: powder blue;
font-style:Minion;
font-size:50%};
</style>
<head>
<body>
<h1> Worldcup Groups <h1>
<table id="myTable" border="1">
<tr>
<td>Game1</td>
<td>India</td>
</tr>
<tr>
<td>Game2</td>
<td>Pakistan</td>
</tr>
<tr>
<td>Game3</td>
<td>Sri Lanka</td>
</tr>
</table>
<formname = "test">
<p>
<label>Email Address:
<input type = "text"value="e.g. (e-mail address removed)" name =
"emailaddress" size = "35" maxlength=
"35"/>
</label>
</P>
<input type="button" onclick="changeContent()" value="Change content">
</form>
</body>
</html>