homepage Welcome to WebmasterWorld Guest from 54.237.98.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Form Variables With Javascript
Help
mbennie

10+ Year Member



 
Msg#: 361 posted 7:40 am on Apr 13, 2003 (gmt 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.

 

ShawnR

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 361 posted 11:24 am on Apr 13, 2003 (gmt 0)

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

Shawn

Birdman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 361 posted 11:29 am on Apr 13, 2003 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved