Data
Today, a friend asked me about using JavaScript to carry out the data transmission between the pages of the page, I have written before, but never noticed, today summed up a bit, hoping to give you some help, but also help me to sum up the previous learned, used knowledge.
One, the simplest is the same page in the form of data transmission.
For example, there are two forms on a Web page, a text box in each form, and a button. The point button pairs each other to manipulate the value of each other's text box. The example we give is to pay a text box to another text box. The specific HTML code is as follows:
<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body>
<form name= "Form1" method= "Post" action= "" >
<input type= "text" name= "TextField" >
<input type= "button" Name= "Submit" value= "1--------->2" >
</form>
<form name= "Form2" method= "POST" action= "" >
<input type= "text" name= "Textfield2" >
<input type= "button" Name= "Submit" value= "2----->1" >
</form>
</body>
The above HTML code, you may notice the Onclik code, there are two functions, followed by the JavaScript code:
<script language= "JavaScript" >
function ok ()
{
Document.form2.textfield2.value=document.form1.textfield.value;
}
function Ok1 ()
{
Document.form1.textfield.value=document.form2.textfield2.value;
}
</script>