Question about displaying hidden controls

G

Guest

I've given up trying to use the AJAX ModalPopupExtender and have opted,
instead, for using a hidden dropdownlist on my form. How do I get the
dropdownlist and it's corresponding label to display when a user enters a
value in a textbox? I thought about doing so whenever OnKeyDown or
OnKeyPress or, even, the OnTextChanged within that text box are fired, but I
can't seem to get it to work.
 
G

Guest

I wish it was possible to go back and edit a post; since it isn't, I thought
I'd clarify my post a bit by stating that I'd like to display the controls
without having to do a postback. As it is now, I can display the controls
only if the user clicks on the OK button.
 
E

Eliyahu Goldin

First of all, you need to hide the ddl with a css rule display:none. If you
use Visible=false, the ddl won't be rendered to the client.

In the javascript events you are going to handle you will need to call this
code:

myDdl = [some code that locates the ddl]
myDdl.style.display='inline';

The exect code that locates the ddl depends on your page. If it is not in a
master page neither inside a user control, you can use
myDdl = document.getElementById('ddlId');

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top