• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sending request parameter on click of button

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic