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

F

F. Da Costa

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
 
M

Mike

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 said:
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
 
F

F. Da Costa

Mike said:
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
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
 
@

@SM

"F. Da Costa" a ecrit :

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
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:[email protected]
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanemoriaux/internet/
**************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top