By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,165 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,165 IT Pros & Developers. It's quick & easy.

onChange with checkbox

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.