• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filter a combobox

 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if I should have posted this in the javascript section.
I have a combo box (drop down box), whose values I get from a bean.
Next to the combo box is a text box with a link next to it which would say filter. when the user types in a value and clicks on that link,
I need to filter the values of an already populated dropdown box, and am at loss to understand, how I would/could do it.
I would be grateful if someone can guide me in this.

thanks
 
Matteo Di Furia
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have the combo box values generated by the servlet calling the jsp. The servlet should include a mechanism in which, given a parameter, you filter the set of values accordingly to that param. The link must provide that param to the servlet firing a JSP reloading.
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Thanks for your reply. This was the last option on my mind. This IS possible, no doubt, but I am sure there is a better way to do this.May be javascript.. may be jason.. I dont know
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to filter the values of an already populated dropdown box,


If you want to filter already populated values, then it can be done with Javascript, if you want to repopulate them without refresh, then I think Ajax or jquery can help.



Hope this helps
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Anna:
I am not sure if I should have posted this in the javascript section.
I'll move it there if that turns out to be the case. Please answer the questions I pose in the rest of this reply.

I have a combo box
No, you don't. There's no combo box control in HTML. Please read this for more information.

when the user types in a value and clicks on that link, I need to filter the values of an already populated dropdown box
Using what information? Do you need to go back to the server in order to obtain more info? Or do you have everything you need already at the client? You'll need to pony up and let us know what this "filtering" entails.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!