show/hide children of composite control in javascript

L

Lisa Calla

Hi,
I have a composite control made of a textbox and a label. I want to show
either the textbox or the label, and hide the other control on the client
side in response to a click. I can run a function belonging to the control,
but I can't seem to alter the visibility of the children. My composite
control has this client-side code:
function disable() {
alert('In disable');
document.getElementById("TextBox1").style.display="none";
document.getElementById("Label1").style.display="inline";
alert('After disable');
return false;
}

I see both alerts, but the code does nothing. Any suggestions?
 
K

Kumar Reddi

Ok first try to catch visibility value of TextBox1 and
Label1, and see if they are coming properly. Then try to
set. Because the code you posted wouldnt throw any
exception even if the controls with the names you gave are
not found

Kumar
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top