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

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

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


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

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

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