Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending request parameter on click of button

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sending request parameter on click of link is easy, like this way:



Here, we can get key1 and key2 at second.jsp from request paramaeters.

But how to send request parameter on click of button??

Hope my question is clear.

Please suggest me..

Thanks a lot.
[ December 24, 2005: Message edited by: Bear Bibeault ]
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really an (X)HTML question. I assume the button you refer to is like a 'submit' button on a form. In which case, you must first create the HTML form (or XForms if you are using a browser which supports that). You can either add parameters which have fixed values, or form controls which accept user input and produce parameters.

For example:



This creates a button with label 'buttonname' which submits the form (sends a new request to the server) containing the fixed (predetermined) parameters 'key1' and 'key2'.

You can also get user input, for example from a text field:



Now a single-line text field will appear; the string entered will be the value submitted to second.jsp for the parameter with name 'key1'.

You could also choose the form method of GET (rather than POST), if you want the parameters to appear in the user's URL (for bookmarking purposes for instance).

If that doesn't help, or doesn't answer your question, please post a more specific question and I'll take another look.
[ December 24, 2005: Message edited by: Charles Lyons ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic