Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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: 63221
    
  69

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: 63221
    
  69

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: 63221
    
  69

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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: hide dropdown list
 
It's not a secret anymore!