• 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

value of the textbox to a scriplet in JSP

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am developing an application where i am having 2 combo boxes and
those combo boxes were populated by the value from databases.I have
populated my 1st combo box by using a Java bean where i have used sql
query.But for populating the 2nd combo box i need to use another bean
where i have to give the selected value of the 1st combo box in the
where condition of its SQL query.

I tried to get this selected value by taking the value in a text-box
through JavaScript and then tried to pass the value of the text-box in
the scriptlet n thus pass it in 2nd Java Bean.but unfortunately
every time i got null value.
Can you please tell me how to pass this value in a variable in scriptlet.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I tried to get this selected value by taking the value in a text-box
through JavaScript and then tried to pass the value of the text-box in
the scriptlet n thus pass it in 2nd Java Bean.

It sounds as if you are trying to mix client and server-side code, and that just can't happen. Please read this article to find out why.

What you are trying to do has pretty much become the "poster child" example for using Ajax to retrieve the dynamic context of the secondary select element (by the way, it's not a "combo box", there is no such native control on the web).

Search the HTML forum for "dependent dropdown" or "cascading dropdown" for many previous disucssions of just this issue.
[ October 01, 2007: Message edited by: Bear Bibeault ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic