There is a little problem.
I have TWO HTML forms, there are two fields on both forms.
When i press the SUBMIT button of first form then i want that fields of Second form will be filled with that data (which i typed in form1). I dont want to refresh the second form to see the result. Thats why i want to use javascript.
How can i implement this. please help in this regard.
Thanks
little problem in javascript
Moderator: General Moderators
- abeterosso
- Forum Newbie
- Posts: 11
- Joined: Fri Mar 16, 2007 8:50 am
- Location: Italy
feyd | Please use
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
...try this code:
[syntax="html"]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, http://www.pspad.com">
<title></title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function Invio()
{
document.Form2.textBox3.value = document.Form1.textBox1.value;
document.Form2.textBox4.value = document.Form1.textBox2.value;
}
</SCRIPT>
<FORM NAME=Form1>
<P>Enter new text:
<INPUT TYPE="text"
NAME="textBox1">
<INPUT TYPE="text"
NAME="textBox2">
<INPUT TYPE="button"
VALUE="Submit"
onClick="Invio();">
</FORM>
<FORM NAME=Form2>
<P>Text from Form1:
<INPUT TYPE="text"
NAME="textBox3" VALUE="">
<INPUT TYPE="text"
NAME="textBox4" VALUE="">
</FORM>
</body>
</html>
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]