Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
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
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
HTML Pages with CSS and JavaScript
hide dropdown list
anvi kon
Ranch Hand
Posts: 148
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Sheriff
Posts: 67750
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Establish a focus handler on the text box. In the handler, show or hide the select element.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Bear Bibeault
Sheriff
Posts: 67750
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Using jQuery:
$('#myTextBox').focus(function(){ $('#mySelect').toggle(); });
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.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
anvi kon
Ranch Hand
Posts: 148
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can I do it in javascript?
<TD class="maincontent4" style="width: 198px"> <html:text property="event" tabindex="2" onclick = show(); onkeyup="javascript:this.value=this.value.toUpperCase();" /> </TD> <TD class="maincontent4" style="width: 198px"> <html:select property="event" onchange="onChange(this.value)" tabindex="5" > onkeyup="javascript:this.value=this.value.toUpperCase();"> <html:option value="option1">option1</html:option> <html:option value="option2">option2</html:option> <html:option value="option3"> option3</html:option> <</html:select> </TD>
thanks
Bear Bibeault
Sheriff
Posts: 67750
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Whatever. Here's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to show a textfield dynamically using struts..(URGENT)
How to show a textfield dynamically
how to show same row for each click on a link
DropDown List when i focus the textBox
DropDownList value changes
More...