473,406 Members | 2,273 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,406 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 50892
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.