473,511 Members | 16,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkboxlist add onchange event

i've tried to add an onchange event to my checkboxes(created dynamically)

chkboxlist.attributes.add("onchange", "dothat();")

but it renders the onchange to the table it creates and not to the list
items. I need to add the onchange event to all the checkbox(s) that are
created dynamically. I've even tried

dim li as ListItem
for each li in chkboxlist
li.attributes.add("onchange", "dothat();")
next

but it still renders to the table that the chkboxlist creates rather than
the items.

Can this be done? If so can someone give some good examples?
thanks!

jason
Aug 1 '08 #1
1 4100
the checkboxes are rendered as html, not control, so this can not be
done serverside. you need to attach the click handlers with client
script, or override the render of the clicklist.

-- bruce (slwork.com)

Jason Hartsoe wrote:
i've tried to add an onchange event to my checkboxes(created dynamically)

chkboxlist.attributes.add("onchange", "dothat();")

but it renders the onchange to the table it creates and not to the list
items. I need to add the onchange event to all the checkbox(s) that are
created dynamically. I've even tried

dim li as ListItem
for each li in chkboxlist
li.attributes.add("onchange", "dothat();")
next

but it still renders to the table that the chkboxlist creates rather than
the items.

Can this be done? If so can someone give some good examples?
thanks!

jason

Aug 1 '08 #2

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

Similar topics

2
2241
by: S Wickes | last post by:
I've become suspicious that the submit button does not count as an onChange event in some browsers. Here's why. I have a form with many textareas. After you click submit, I only update the...
1
20674
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
10
7623
by: Ryan McGeary | last post by:
In a <select> drop-down, the onchange event isn't called when scrolling through the dropdown using the mouse-wheel and when crossing over a new <optgroup>. Using the example below, notice how...
2
12116
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
4
4072
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
3
3963
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
3
3891
by: b_naick | last post by:
I realize that the onChange event for a drop down can be trapped as follows: <select name="myDropDown" onChange="somefunc"> Is it possible to trap the onChange event outside of the select...
21
29741
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
0
7242
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
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
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
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.