Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

How can I make dropdown div, which has text boxes in it (two). I want it to be visible a button is clicked (a button with an arrow on it).

Whats the CSS for that?
Posted

1 solution

It's very simple. Take a div and set it's display property to none, then write a javascript function which will set the display property of div to block, then call the javascript function on button click.

HTML
<div id="dropdown" style="display:none">
 <input type="text" width="100" height="30" />
</div>

Javascript function:-
JavaScript
function ShowDiv()
{
  document.getElementById("dropdown").style.display="block";
}

Now call this JavaScript function on button click.
that's it!

Good luck.
 
Share this answer
 
v2
Comments
FahdSanaullah 29-Jul-12 14:18pm    
Thanks. But there's one other problem : There are combo boxes below the Div dropdown, when it becomes visible (the DIV), they go down to give it space. I want it to cover them and stop them from going down? Like bringing it to front. What do I do?
FahdSanaullah 29-Jul-12 14:34pm    
Ok. Solved it with position the DIV absoute. Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900