This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes get parameter from another Form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "get parameter from another Form" Watch "get parameter from another Form" New topic

get parameter from another Form

Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

Can anyone tell me if it is possible to get a parameter from another Form (on the same HTML page) and submit the values along with the Form that is being submitted? For example, I have a text field in Form 1 (same page) and I want to be able to get the value of the field and submit that along with data from Form 2. There should be a way to do this task with JavaScript. If someone could kindly point the way?
Many thanks,
Shubhrajit Chatterjee
Ranch Hand

Joined: Aug 23, 2001
Posts: 356
In form one, have a hidden field say ... hid1
then do this from javascript
document.form1.hid1.value = dcoument.form2.someinputfield.value

Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

Brilliant! Thanks a lot!
I agree. Here's the link:
subject: get parameter from another Form
It's not a secret anymore!