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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • F. Da Costa

    [<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
  • Mike

    #2
    Re: [&lt;input type=&quot;chec kbox&quot;&gt;] onSelect vs. onClick

    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" <dacosta@xs4all .nl> wrote in message
    news:3fd72129$0 $210$e4fe514c@n ews.xs4all.nl.. .[color=blue]
    > Hi,
    >
    > Does the following indeed imply that this event is NOT called when an[/color]
    <input type="checkbox" is toggled?[color=blue]
    > This would thus imply the usage of the onClick handler instead (assuming[/color]
    an action needs to be invoked on check/ uncheck).[color=blue]
    >
    > W3C Recomendation:
    > 18 Scripts
    >
    > onselect = script [CT]
    > The onselect event occurs when a user selects some text in a text[/color]
    field. This attribute may be used with the INPUT[color=blue]
    > and TEXTAREA elements.
    >
    > I *know* the onClick can be used, I am just wondering about the use og[/color]
    onSelect.[color=blue]
    >
    > TIA,
    > Fermin DCG[/color]


    Comment

    • F. Da Costa

      #3
      Re: [&lt;input type=&quot;chec kbox&quot;&gt;] onSelect vs. onClick

      Mike wrote:[color=blue]
      > 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.
      >[/color]
      fair enough[color=blue]
      > try onClick, onFocus, onBlur[/color]
      did that (the onClick) and it obviously works just fine

      Thx for the reply[color=blue]
      >
      >
      > "F. Da Costa" <dacosta@xs4all .nl> wrote in message
      > news:3fd72129$0 $210$e4fe514c@n ews.xs4all.nl.. .
      >[color=green]
      >>Hi,
      >>
      >>Does the following indeed imply that this event is NOT called when an[/color]
      >
      > <input type="checkbox" is toggled?
      >[color=green]
      >>This would thus imply the usage of the onClick handler instead (assuming[/color]
      >
      > an action needs to be invoked on check/ uncheck).
      >[color=green]
      >>W3C Recomendation:
      >>18 Scripts
      >>
      >>onselect = script [CT]
      >> The onselect event occurs when a user selects some text in a text[/color]
      >
      > field. This attribute may be used with the INPUT
      >[color=green]
      >>and TEXTAREA elements.
      >>
      >>I *know* the onClick can be used, I am just wondering about the use og[/color]
      >
      > onSelect.
      >[color=green]
      >>TIA,
      >>Fermin DCG[/color]
      >
      >
      >[/color]

      Comment

      • @SM

        #4
        Re: [&lt;input type=&quot;chec kbox&quot;&gt;] onSelect vs. onClick

        "F. Da Costa" a ecrit :
        [color=blue]
        > Mike wrote:[color=green]
        > > 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.[/color][/color]

        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(thi s.checked==true ) alert('I\'m selected');">
        <input type=radio name="un" value="Radio 1"
        onclick="if(thi s.checked==true ) alert(this.valu e+' is selected');">
        <input type=radio name="un" value="Radio 2"
        onclick="if(thi s.checked==true ) alert(this.valu e+' is selected');">
        <input type=text value=" nothing" onselect="alert ('No modif !'); this.blur();">
        </form></html>

        See your W3C if they talk about onchecked ?
        [color=blue]
        >[color=green]
        > >[/color]
        > fair enough[color=green]
        > > try onClick, onFocus, onBlur[/color]
        > did that (the onClick) and it obviously works just fine
        >
        > Thx for the reply[color=green]
        > >
        > >
        > > "F. Da Costa" <dacosta@xs4all .nl> wrote in message
        > > news:3fd72129$0 $210$e4fe514c@n ews.xs4all.nl.. .
        > >[color=darkred]
        > >>Hi,
        > >>
        > >>Does the following indeed imply that this event is NOT called when an[/color]
        > >
        > > <input type="checkbox" is toggled?
        > >[color=darkred]
        > >>This would thus imply the usage of the onClick handler instead (assuming[/color]
        > >
        > > an action needs to be invoked on check/ uncheck).
        > >[color=darkred]
        > >>W3C Recomendation:
        > >>18 Scripts
        > >>
        > >>onselect = script [CT]
        > >> The onselect event occurs when a user selects some text in a text[/color]
        > >
        > > field. This attribute may be used with the INPUT
        > >[color=darkred]
        > >>and TEXTAREA elements.
        > >>
        > >>I *know* the onClick can be used, I am just wondering about the use og[/color]
        > >
        > > onSelect.
        > >[color=darkred]
        > >>TIA,
        > >>Fermin DCG[/color]
        > >
        > >
        > >[/color][/color]

        --
        *************** *************** *************** *************** **
        Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
        Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

        *************** *************** *************** *************** **


        Comment

        Working...