473,396 Members | 1,836 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,396 software developers and data experts.

Client Side Checkbox Code

I have a checkbox on a web page. When it is checked, I want a Table to appear (or disappear when the checkbox is cleared)... I was hoping to use client side code for this, so I created a short vbscript routine and added this to my code behind module:

chkRecur.Attributes.Add("onchange", "vbscript: ShowRecurringTable")

Now, this works just fine on a couple of textboxes that I'm using, but when I try this technique with the asp checkbox, the "onchange" attribute gets added to a <span> element before the <input> element when rendered...

Can someone explain why this is happening? Can someone explain a simple way to accomplish this with an ASP checkbox server control, without requiring a trip back to the server? Thanks.

Jerry
Dec 16 '05 #1
4 6908
<Span> should not be an issue. Is it not working that way? I often add
my OnChange events into span blocks.

Remy

Dec 16 '05 #2
The code never runs when the checkbox is clicked... I ended up using the
server side event.

"Remy" <rb********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
<Span> should not be an issue. Is it not working that way? I often add
my OnChange events into span blocks.

Remy

Dec 16 '05 #3
Hi Jerry,

The ASP.NET CheckBox control is a customized one compared to the raw html
<input type=checkbox....> element. So it use a <span> to wrapper the <input
type=checkbox> and a <label> (normal html checkbox dosn't have text
.......). Thus, all the serverside attributes we apply on the asp.net
checkbox control will appear in the <span> element..... As for this
problem, I used to use the "onclick" event instead since each time the
"onclick" event occur, the checkbox's <span> will also notify its child
element and cause the <input checkbox> also change status.... You can have
a try on this to see whether it helps.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: <rl*****@newsgroups.nospam>
| References: <uG**************@TK2MSFTNGP10.phx.gbl>
<11**********************@o13g2000cwo.googlegroups .com>
| Subject: Re: Client Side Checkbox Code
| Date: Fri, 16 Dec 2005 16:32:45 -0500
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <O6**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 198.160.134.100
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365409
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| The code never runs when the checkbox is clicked... I ended up using the
| server side event.
|
| "Remy" <rb********@hotmail.com> wrote in message
| news:11**********************@o13g2000cwo.googlegr oups.com...
| > <Span> should not be an issue. Is it not working that way? I often add
| > my OnChange events into span blocks.
| >
| > Remy
| >
|
|
|

Dec 19 '05 #4
Hi Jerry,

Does the suggestion in my last reply helps you a little, if there're
anything else we can help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 51533511
| References: <uG**************@TK2MSFTNGP10.phx.gbl>
<11**********************@o13g2000cwo.googlegroups .com>
<O6**************@TK2MSFTNGP09.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 19 Dec 2005 03:21:47 GMT
| Subject: Re: Client Side Checkbox Code
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <zk**************@TK2MSFTNGXA02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 50
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365623
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Jerry,
|
| The ASP.NET CheckBox control is a customized one compared to the raw html

| <input type=checkbox....> element. So it use a <span> to wrapper the
<input
| type=checkbox> and a <label> (normal html checkbox dosn't have text
| ......). Thus, all the serverside attributes we apply on the asp.net
| checkbox control will appear in the <span> element..... As for this
| problem, I used to use the "onclick" event instead since each time the
| "onclick" event occur, the checkbox's <span> will also notify its child
| element and cause the <input checkbox> also change status.... You can
have
| a try on this to see whether it helps.
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
| --------------------
| | From: <rl*****@newsgroups.nospam>
| | References: <uG**************@TK2MSFTNGP10.phx.gbl>
| <11**********************@o13g2000cwo.googlegroups .com>
| | Subject: Re: Client Side Checkbox Code
| | Date: Fri, 16 Dec 2005 16:32:45 -0500
| | Lines: 12
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| | Message-ID: <O6**************@TK2MSFTNGP09.phx.gbl>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: 198.160.134.100
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:365409
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | The code never runs when the checkbox is clicked... I ended up using
the
| | server side event.
| |
| | "Remy" <rb********@hotmail.com> wrote in message
| | news:11**********************@o13g2000cwo.googlegr oups.com...
| | > <Span> should not be an issue. Is it not working that way? I often add
| | > my OnChange events into span blocks.
| | >
| | > Remy
| | >
| |
| |
| |
|
|

Dec 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cathryn Lindner | last post by:
I have a web form that has a checkbox on it and a textbox associated with it. I want the textbox to be displayed when the checkbox is checked and I want this to happen on the client-side instead of...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
3
by: Earl Teigrob | last post by:
I wanted my "Terms and Conditions" Checkbox control to participate in my ASP.NET validation just like all the the other controls on the page. After some time of searching the web for an example of...
3
by: Yama | last post by:
Hi, I have a datagrid with several columns and a single column containing a checkbox. The grid has some client-side javascript and style sheet that allows rollover change of row color. I...
2
by: Paul | last post by:
If it's possible I would like to perform some client side actions on my Visual Basic asp.net application. An example of what I'm trying to do. I have a DATAGRID with columns ITEM, ITEMTYPE and a...
5
by: rodchar | last post by:
hey all, i have a datagrid with checkboxes on it and i was wondering if i can do the following: if a user clicks on the checkbox it makes a server-side button visible. can i make this happen...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
1
by: avp | last post by:
Hi, We have an ASP.NET 2.0 (C#) application that has a web form with a CheckBoxList control and a CustomValidator control. The CustomValidator control is used to validate that at least one...
13
by: HockeyFan | last post by:
I'm not sure how to exactly ask this, but expect that it's a Javascript solution. However, I'll ask the question and maybe someone can point me to some existing code that will do what I need. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.