aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes hide  dropdown list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "hide  dropdown list " Watch "hide  dropdown list " New topic
Author

hide dropdown list

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Hi,

Is anyone tell me , How to pop up or show the dropdown list onlick event of textbox?

I have one textbox and dropdownlist. whenever I click the textbox show the dropdownlist otherwise hide it.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

Establish a focus handler on the text box. In the handler, show or hide the select element.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

Using jQuery:

Without jQuery: well, life's too short to deal with doing this in raw JavaScript with all the IE warts with respect to event handling in a cross-browser fashion.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Can I do it in javascript?




thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

jQuery is "doing it with JavaScript". jQuery is a JavaScript library.

If you want to do it "by hand", sure you can do that too -- it's just more code.
 
 
subject: hide dropdown list