473,383 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 2340
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
2
by: Flo | last post by:
Hello I want to be able to show/hide an application that is running. When i am getting the handles corresponding to an MS Office application (Excel for example), it appears that i get a handle...
5
by: dje | last post by:
In the OnClick event on a radioButtonList, I run a javascript to show/hide the appropriate div along with a submit button, which displays as expected. The problem is the submit no longer works on...
3
by: sorCrer | last post by:
Hi All, Posted after extensive searching! I have a nested repeater control as follows: (Simplified ;-)) <table> <asp:repeater id=parent onItemDataBound=createChild> <tr><td>Level...
6
by: Nestor | last post by:
Is this possible at all? I'm working on a Atlas project which at one point requires me to hide an ASP.net control with Javascripts running on the client side. Anyone able to provide any help on...
2
by: UJ | last post by:
Is there a way with a asp:checkbox to run a JavaScript to display/hide text/input on the screen without doing a postback? I also need to be able to access the stuff at the server so I need to...
1
by: shapper | last post by:
Hello, I created an Asp:Repeater where I have an Asp:Panel and an Asp:Label. In each record of the repeater I want to have a small button which hides or shows the panel in that record. If...
2
by: billsahiker | last post by:
I have an asp.net page that dynamically generates client-side javascript. What javascript would hide a control? Specifically, I have a composite web server control and when the user clicks a button...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.