File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes getting parameterValues from a separate frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting parameterValues from a separate frame" Watch "getting parameterValues from a separate frame" New topic

getting parameterValues from a separate frame

Trevor Pereira

Joined: Sep 11, 2002
Posts: 12
I have two frames. The frame at the bottom contains my submit button that calls my servlet while the top frame contains my values that I need to pass via HttpRequest.
How do I retrieve those parameters from the top frame. "getParameterValue(String)" only works where the form data is in your current frame
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
For programming on the browser, your only real choice is JavaScript. You can use it to grab variables from the form(s) in the top Frame as they are entered and stick the values in hidden form variables in the bottom. You can also use it to do preliminary validation.
There are LOTS of Javascript books.
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
This isn't a Javascript forum, so I'll keep this short. I think that the easiest way to do this is to add an "onBlur()" method to each INPUT element in the top form, and have it set the value of a corresponding hidden INPUT element of the real form in the bottom frame.
When you do a form submit, only the name/value pairs from the submitting form are passed, and it is not possible to have a form spread across two frames -- they are treated as separate documents by the browser.
Good Luck!
[ November 14, 2002: Message edited by: Philip Shanks ]

Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
I agree. Here's the link:
subject: getting parameterValues from a separate frame
It's not a secret anymore!