I have two pages. The first page contain a table with title and the second contain texts & selected option.
I want it so when a user in second page clicks the submit button, his information is inserted in the table in the first page according the title in table.
How would i do this?
............... .
here is my first page code:
............... ............... ............... ........
here is my second page source:
I want it so when a user in second page clicks the submit button, his information is inserted in the table in the first page according the title in table.
How would i do this?
............... .
here is my first page code:
Code:
<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("\add.html");
}
</script>
</head>
<body>
<p align="center"><big>WellCome</big></p>
<iframe id="myframe" src="" width="400" height="300" name="iframe">
</iframe>
<script type="text/javascript">
document.getElementById("myframe").align="center"
</script>
<br>
<br>
<br>
<form name="f1" method="post">
<table width="100%">
<tr >
<td >
Reading English<br />
<table class="menu" id="tutorials" width="120" name="read">
<tr><td class="menu"><a href="http://www.writingenglish.com" target="iframe">ReadPart01</a></td></tr>
<tr><td class="menu"><a href="http://www.writingenglish.comp" target="iframe">ReadPart02</a></td></tr>
<tr><td class="menu"><a href="http://www.writingenglish.com" target="iframe">ReadPart03</a></td></tr>
<tr><td class="menu"><a href="http://www.writingenglish.com" target="iframe">ReadPart04</a></td></tr>
<tr><td class="menu"><a href="http://www.writingenglish.com" target="iframe">ReadPart05</a></td></tr>
</table>
</td>
<td >
Listening English<br />
<table class="menu" id="tutorial" width="120">
<tr><td class="menu"><a href="http://www.englishlistening.com/" target="iframe">ListenPart01</a></td></tr>
<tr><td class="menu"><a href="http://www.englishlistening.com/" target="iframe">ListenPart02</a></td></tr>
<tr><td class="menu"><a href="http://www.englishlistening.com/" target="iframe">ListenPart03</a></td></tr>
<tr><td class="menu"><a href="http://www.englishlistening.com/" target="iframe">ListenPart04</a></td></tr>
<tr><td class="menu"><a href="http://www.englishlistening.com/" target="iframe">ListenPart05</a></td></tr>
</table>
</td>
<td >
Writing English<br />
<table class="menu" id="scripting" width="120">
<tr><td class="menu"><a href="http://www.talkenglish.com/" target="iframe">WritePart01</a></td></tr>
<tr><td class="menu"><a href="http://www.talkenglish.com/" target="iframe">WritePart02</a></td></tr>
<tr><td class="menu"><a href="http://www.talkenglish.com/" target="iframe">WritePart03</a></td></tr>
<tr><td class="menu"><a href="http://www.talkenglish.com/" target="iframe">WritePart04</a></td></tr>
<tr><td class="menu"><a href="http://www.talkenglish.com/" target="iframe">WritePart05</a></td></tr>
</table>
</td>
<td >
Speaking English<br />
<table class="menu" id="validation" width="120">
<tr><td class="menu"><a href="http://www.englishclub.com/reading/short-stories.htm" target="iframe">SpeakPart01</a></td></tr>
<tr><td class="menu"><a href="http://www.englishclub.com/reading/short-stories.htm" target="iframe">SpeakPart02</a></td></tr>
<tr><td class="menu"><a href="http://www.englishclub.com/reading/short-stories.htm" target="iframe">SpeakPart03</a></td></tr>
<tr><td class="menu"><a href="http://www.englishclub.com/reading/short-stories.htm" target="iframe">SpeakPart04</a></td></tr>
<tr><td class="menu"><a href="http://www.englishclub.com/reading/short-stories.htm" target="iframe">SpeakPart05</a></td></tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<input type=button value="Add New Address" onclick="open_win()">
</form>
</body>
</html>
here is my second page source:
Code:
<html>
<head>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("frm1").submit();
}
function passmain(){
if (document.getElementByname('cat').value =="1") {
var cell_obj = window.opener.document.getElementById('tutorials').insertRow().insertCell()
cell_obj.innerHTML= document.getElementById('txt2').value
}
else
if (document.getElementByname('cat').value =="2") {
var cell_obj = window.opener.document.getElementById('tutorial').insertRow().insertCell()
cell_obj.innerHTML= document.getElementById('txt2').value
}
else
if (document.getElementByname('cat').value =="3") {
var cell_obj = window.opener.document.getElementById('validation').insertRow().insertCell()
cell_obj.innerHTML= document.getElementById('txt2').value
}
else
if (document.getElementByname('cat').value =="4") {
var cell_obj = window.opener.document.getElementById('scripting').insertRow().insertCell()
cell_obj.innerHTML= document.getElementById('txt2').value
}
}
}
</script>
</head>
<body onbeforeunload="passmain()">
<p> You can Add your Address Here :</p>
<form id="frm1" method="get" action="demo.htm">
write the address : <input name="txtadd" type="text" id="txt1"> <br>
write a name for it! : <input name="txtcat" type="text" id="txt2"> <br>
choose your category: <select name="cat">
<option value="1">ReadingEnglish </option>
<option value="2"> ListeningEnglish </option>
<option value="3"> WritingEnglish </option>
<option value="4"> SpeakingEnglish </option>
</select>
<br>
<br>
<input name="btn1" type="button" onclick="passmain()" value="Click to Add it ! " ><br>
</form>
</body>
</html>
Comment