This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Submitting other elements outside a form with a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Submitting other elements outside a form with a form" Watch "Submitting other elements outside a form with a form" New topic
Author

Submitting other elements outside a form with a form

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
I have a form on a jsp and it submits ok to a servlet. However I want some additional parameters to be submitted along with the form (These parameters are outside the form) - for instance some of the values present in a label tag. One way that i think this could be accomplished by is setting onsubmit= "AttachParameters()" and the value of those parameters will be inserted in hidden fields in my form. Are there any better ways ???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60748
    
  65

That's the way that I'd go about it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Submitting other elements outside a form with a form
 
Similar Threads
redirecting or forwarding to another website
best place to put configuration properties.
how i can submit a form along with some parameters using javascript ?
How to hide the parameters shown in the url while submitting a form
how to add data in request object and pass it to next page?