File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Creating Editable Combo-box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Creating Editable Combo-box" Watch "Creating Editable Combo-box" New topic
Author

Creating Editable Combo-box

Ganesh MV
Greenhorn

Joined: Sep 29, 2006
Posts: 5
I'm using a combo box in web page and the values of
the combo are fetched from database. Now I need
to allow the user to add his own entry to the combo,
if he doesn't find a proper option in the combo.

how to make the combo editable? please give me your valuable inputs.
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
to my best knowledge you'll need a seperate input field and something like a "add" button. and one to "remove". and one to "edit"...

all this will result in a reloaded combo-box, which means that you cannot manipulate it on the fly, even though you might use ajax to give it a "on the fly"-impression.

:-)

jan
Ganesh MV
Greenhorn

Joined: Sep 29, 2006
Posts: 5
Hi Jan,

thanks for your reply. I'll try adding another text box
to add values to combo.

thanks again.
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Ganesh,
A JS is available on net(i dont have the link) that would do the same what you desire. I couldnt post the same coz if JS validation on javaranch. Please search adn you should be able to find it. I had the same for my code..
Regards,
Roshani


Regards,<br />Roshani
Ganesh MV
Greenhorn

Joined: Sep 29, 2006
Posts: 5
Hi Roshani,

I've searched in the net as you told and i got
some javascripts which works perfectly.

now i'm able to add new entry in my combo.

thanks for your suggestion.
 
wood burning stoves
 
subject: Creating Editable Combo-box
 
Similar Threads
editable joptionpane.showInputDialog comboBox?
key listener for editable combo box.
text wrap in combo box.
JComboBox Mystery!
Focus listener for Editable Combo Box