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

onChange with checkbox

I wanted to use onChange with some checkboxes. However, the function is only
called when the focus is shifted to the next field.

Instead I would like my function to be called as soon as the user changes
the checkbox. Is that possible?

Thanks,
Wim
Jul 20 '05 #1
4 50880
In article <bo**********@reader08.wxs.nl>, wimroffelplease@nospamm-
planet.nl enlightened us with...
I wanted to use onChange with some checkboxes. However, the function is only
called when the focus is shifted to the next field.

Instead I would like my function to be called as soon as the user changes
the checkbox. Is that possible?


Any click changes the box for that element. Use onClick. Be careful -
IIRC, the onClick fires *before* the "checked" property is changed.
Check on that if you use it.
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2
Yes, try onClick instead

Stu

"Wim Roffal" <wi*************@nospamm-planet.nl> wrote in message
news:bo**********@reader08.wxs.nl...
I wanted to use onChange with some checkboxes. However, the function is only called when the focus is shifted to the next field.

Instead I would like my function to be called as soon as the user changes
the checkbox. Is that possible?

Thanks,
Wim

Jul 20 '05 #3
or onMouseDown/onMouseUp

"Stuart Palmer" <tr**********@youcant.com> wrote in message
news:bo***********@sp15at20.hursley.ibm.com...
Yes, try onClick instead

Stu

"Wim Roffal" <wi*************@nospamm-planet.nl> wrote in message
news:bo**********@reader08.wxs.nl...
I wanted to use onChange with some checkboxes. However, the function is

only
called when the focus is shifted to the next field.

Instead I would like my function to be called as soon as the user changes the checkbox. Is that possible?

Thanks,
Wim


Jul 20 '05 #4
Hi,

Thanks to all who replied to my question. I'll go for the onClick!

Wim
"kaeli" <ti******@NOSPAM.comcast.net> schreef in bericht
news:MP************************@nntp.lucent.com...
In article <bo**********@reader08.wxs.nl>, wimroffelplease@nospamm-
planet.nl enlightened us with...
I wanted to use onChange with some checkboxes. However, the function is only called when the focus is shifted to the next field.

Instead I would like my function to be called as soon as the user changes the checkbox. Is that possible?


Any click changes the box for that element. Use onClick. Be careful -
IIRC, the onClick fires *before* the "checked" property is changed.
Check on that if you use it.
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------

Jul 20 '05 #5

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

Similar topics

2
by: F. Da Costa | last post by:
Hi, I'm trying to call/ mimic an onchange function/ event after a user has clicked a checkbox. In response to which a buncch of other ones need to be checked as well. The caveat is that each of...
7
by: Michele | last post by:
I am creating a web page that has a select box. Depending on what is selected, I would like to display certain checkboxes. Example: If '100 Level' is selected, I want 2 checkboxes. 1)Name...
2
by: otto | last post by:
I have a form that is used for uploading photos. I have a check box for specifying that the photo being uploaded should appear on a specific web page rather than just be stored in the database for...
13
by: aundro | last post by:
Hello, I've been looking on the web for a solution to this problem: I create a set of checkboxes, and 2 buttons: - one is labeled "All" - the other is labeled "None" Clicking "All" is...
2
by: saurabh | last post by:
Hi in my code i have a line Rad2.Attributes.Add("onclick","onchange2();"); This is working perfectly fine.When user clicks the Rad2 radiobutton onchange2(); function gets executed. but in...
6
by: Daz | last post by:
Hi everyone. Firstly, I apologise if this i not what you would call a PHP problem. I get quite confused as to what lives in which realm, so if this shouldn't be posted here, please suggest where...
2
by: John Gara | last post by:
Hello all I have two checkboxes, but I want the second checkbox to be disabled if the first isn't checked. I created a simple function in javascript on the onchange. function changeSubOption()...
2
by: Mark | last post by:
Sorry for the double post, but I got no responses from the first group... I have a sample page. See link. http://comptrex.com/star/startest.htm It has a select box that contains a list of...
21
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...
7
by: Aaron Gray | last post by:
I am finding that <input type="checkbox" onchange="alert('test')"></input> does not seem to work properly on IE7. http://www.aarongray.org/Test/JavaScript/checkbox.html It works fine on FF and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.