469,927 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

show/hide children of composite control in javascript

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="i nline";
alert('After disable');
return false;
}

I see both alerts, but the code does nothing. Any suggestions?
Nov 18 '05 #1
1 2219
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
-----Original Message-----
Hi,
I have a composite control made of a textbox and a label. I want to showeither the textbox or the label, and hide the other control on the clientside 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 compositecontrol has this client-side code:
function disable() {
alert('In disable');
document.getElementById("TextBox1").style.display= "none";
document.getElementById("Label1").style.display="i nline";
alert('After disable');
return false;
}

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

.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MOHSEN KASHANI | last post: by
5 posts views Thread by dje | last post: by
3 posts views Thread by sorCrer | last post: by
1 post views Thread by shapper | last post: by
2 posts views Thread by billsahiker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.