• 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

Passing a Form Parameter

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have two similar forms on a page. They are select boxes,
I know how to pass the options in the select box drop down as
a parameter, but what of if I want to a parameter so that
depending on which of the Select boxes I select a value from,
a parameter is passed. I have two of this forms in my code,
I can select an option from either, and then go to the next page.
But I need to pass a parameter, so that I would know which of
Select boxs I have clicked from, because that would determine
what query is run on the subsquent pages. This parameter can
be attached anywhere, ie with the sumbit buttons, or anywhere
in the form.

All I want is if I select an option from select dropdown 1, a
parameter called box1 is passed, if I select from drowdown 2 ,
a parameter box 2 is passed.

Here is my code



[ December 04, 2007: Message edited by: Ben Souther ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sege,
It looks like you're writing your pages with Struts.
Since Struts offers its own solutions to a lot of typical problems, you're probably better off asking in our Struts forum.
I'll move this thread over there for you.
-Ben
 
Sege Stephen
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben, Sorry. Yes I am using struts for my application, I posted it on the JSP forum because I thought my problem had to do with a JSP page. Anyway thanks for letting me know, knowing that will let me get better and quicker answers next time, also it would me less work for you as well.

Beside, I found the solution to my problem, I try to solve it before posting it here, but once I am getting no where, I thought it was better to as.

I solve it by adding a single line to my code

<input type="hidden" name="param_name" value="box1" />
 
reply
    Bookmark Topic Watch Topic
  • New Topic