469,923 Members | 1,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

[<input type="checkbox">] onSelect vs. onClick

Hi,

Does the following indeed imply that this event is NOT called when an <input type="checkbox" is toggled?
This would thus imply the usage of the onClick handler instead (assuming an action needs to be invoked on check/ uncheck).

W3C Recomendation:
18 Scripts

onselect = script [CT]
The onselect event occurs when a user selects some text in a text field. This attribute may be used with the INPUT
and TEXTAREA elements.

I *know* the onClick can be used, I am just wondering about the use og onSelect.

TIA,
Fermin DCG
Jul 20 '05 #1
3 37480
Well since a checkbox does not cantain any text (it's just a little box with
a check right?) then no, the onSelect probably cannot be used.

try onClick, onFocus, onBlur
"F. Da Costa" <da*****@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl...
Hi,

Does the following indeed imply that this event is NOT called when an <input type="checkbox" is toggled? This would thus imply the usage of the onClick handler instead (assuming an action needs to be invoked on check/ uncheck).
W3C Recomendation:
18 Scripts

onselect = script [CT]
The onselect event occurs when a user selects some text in a text field. This attribute may be used with the INPUT and TEXTAREA elements.

I *know* the onClick can be used, I am just wondering about the use og onSelect.
TIA,
Fermin DCG

Jul 20 '05 #2
Mike wrote:
Well since a checkbox does not cantain any text (it's just a little box with
a check right?) then no, the onSelect probably cannot be used.
fair enough try onClick, onFocus, onBlur did that (the onClick) and it obviously works just fine

Thx for the reply

"F. Da Costa" <da*****@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl...
Hi,

Does the following indeed imply that this event is NOT called when an


<input type="checkbox" is toggled?
This would thus imply the usage of the onClick handler instead (assuming


an action needs to be invoked on check/ uncheck).
W3C Recomendation:
18 Scripts

onselect = script [CT]
The onselect event occurs when a user selects some text in a text


field. This attribute may be used with the INPUT
and TEXTAREA elements.

I *know* the onClick can be used, I am just wondering about the use og


onSelect.
TIA,
Fermin DCG


Jul 20 '05 #3
@SM
"F. Da Costa" a ecrit :
Mike wrote:
Well since a checkbox does not cantain any text (it's just a little box with
a check right?) then no, the onSelect probably cannot be used.

select is select
checked is checked
why to try testing a select on an element wich only be checked or unchecked ???

<html><form>
<input type=checkbox onclick="if(this.checked==true) alert('I\'m selected');">
<input type=radio name="un" value="Radio 1"
onclick="if(this.checked==true) alert(this.value+' is selected');">
<input type=radio name="un" value="Radio 2"
onclick="if(this.checked==true) alert(this.value+' is selected');">
<input type=text value=" nothing" onselect="alert('No modif !'); this.blur();">
</form></html>

See your W3C if they talk about onchecked ?

fair enough
try onClick, onFocus, onBlur

did that (the onClick) and it obviously works just fine

Thx for the reply


"F. Da Costa" <da*****@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl...
Hi,

Does the following indeed imply that this event is NOT called when an


<input type="checkbox" is toggled?
This would thus imply the usage of the onClick handler instead (assuming


an action needs to be invoked on check/ uncheck).
W3C Recomendation:
18 Scripts

onselect = script [CT]
The onselect event occurs when a user selects some text in a text


field. This attribute may be used with the INPUT
and TEXTAREA elements.

I *know* the onClick can be used, I am just wondering about the use og


onSelect.
TIA,
Fermin DCG



--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanemoriaux/internet/
************************************************** ************
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.