Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: open

Message Too Old, No Replies

Form Variables With Javascript

Help

     
7:40 am on Apr 13, 2003 (gmt 0)

Full Member

10+ Year Member

joined:May 18, 2002
posts:210
votes: 0


If I have 2 forms on a page, and form 2 needs some of the input from form 1, what is the best way to transfer the variables to the second form? Javascript?

Any code samples would be greatly appreciated.

11:24 am on Apr 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 27, 2003
posts:664
votes: 0


Have a look at [javascript.internet.com...]

Shawn

11:29 am on Apr 13, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


You can use an event handler to call a function that writes to the second form.

Like:
<form name="form1">
<input type="text" name="field1" onBlur="form2(field1)" />

In the head:
function form2(thefield){
if(thefield == field1){
document.form2.field1.write(document.form1.field1.value)
}
}

Something like that, my JS skills are rusty.