onKeyDown question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Russell Campbell

    onKeyDown question

    I was using onKeyDown to change Enter to Tab. However, in a textarea, this
    prevents a CRLF from being entered and just moves you to the next field. So
    I thought if I put an onKeyDown on the textarea and pass a parameter that
    effectively just tells it to do nothing in that case, then the onKeyDown on
    the textarea would override the one associated with the body tag. No luck,
    though. What would be the proper technique here?

    Thanks for any help,

    Russell Campbell


  • Thomas 'PointedEars' Lahn

    #2
    Re: onKeyDown question

    Russell Campbell wrote:
    [color=blue]
    > I was using onKeyDown to change Enter to Tab.[/color]

    Don't do that.
    [color=blue]
    > [Problems with textarea]
    > What would be the proper technique here?[/color]

    Not to do it. Users expect a form to be submitted if no special
    button is focused and they press Enter, and they expect Tab (and
    Shift+Tab) to move the focus. Don't mess with that.


    PointedEars

    Comment

    • Russell Campbell

      #3
      Re: onKeyDown question

      So you think that rules should just be followed all the time without
      question? I find that many users want to use the Enter key to move between
      fields - *especially* when they are entering a bunch of numbers, which is
      what is happening here. Although I'm a Mac fan from way back, I think
      Apple's decision to put this in the Mac interface and Microsoft's decision
      to follow it was stupid. So I accomodate my users - who don't want this -
      instead of following rules like an automaton. You're free to do it like the
      "standard" says, but I'd rather make my users happy and collect my paycheck.


      "Thomas 'PointedEars' Lahn" <PointedEars@nu rfuerspam.de> wrote in message
      news:40B83482.9 050705@PointedE ars.de...[color=blue]
      > Russell Campbell wrote:
      >[color=green]
      > > I was using onKeyDown to change Enter to Tab.[/color]
      >
      > Don't do that.
      >[color=green]
      > > [Problems with textarea]
      > > What would be the proper technique here?[/color]
      >
      > Not to do it. Users expect a form to be submitted if no special
      > button is focused and they press Enter, and they expect Tab (and
      > Shift+Tab) to move the focus. Don't mess with that.
      >
      >
      > PointedEars[/color]


      Comment

      • Andrew DeFaria

        #4
        Re: onKeyDown question

        Russell Campbell wrote:
        [color=blue]
        > So you think that rules should just be followed all the time without
        > question? I find that many users want to use the Enter key to move
        > between fields - *especially* when they are entering a bunch of
        > numbers, which is what is happening here. Although I'm a Mac fan from
        > way back, I think Apple's decision to put this in the Mac interface
        > and Microsoft's decision to follow it was stupid. So I accomodate my
        > users - who don't want this - instead of following rules like an
        > automaton. You're free to do it like the "standard" says, but I'd
        > rather make my users happy and collect my paycheck[/color]

        Fine. But make it an option! Do not assume that all of your users want
        this just because of your perception that a lot do. There still may be a
        lot that don't.

        --
        Ambition is the last refuge of a failure.

        Comment

        • Richard Cornford

          #5
          Re: onKeyDown question

          Russell Campbell wrote:[color=blue]
          > So you think that rules should just be followed all the time without
          > question? I find that many users want to use the Enter key to move
          > between fields - *especially* when they are entering a bunch of
          > numbers, which is what is happening here. Although I'm a Mac fan
          > from way back, I think Apple's decision to put this in the Mac
          > interface and Microsoft's decision to follow it was stupid. So I
          > accomodate my users - who don't want this - instead of following
          > rules like an automaton.[/color]

          In an Internet context the expectation of the majority of users will be
          the normal behaviour of their web browser (whatever that may be).
          Inexperienced browser users may miss particular GUI styles form other
          application, and may even be vocal about it, but eventually (and
          inevitably) they will become experienced browser users and themselves
          have expectations based on normal browser behaviour. One of the main
          factors that makes a GUI intuitive is that it rewards the expectations
          of its users. It is also probably not a good idea to let the user get
          the impression that even a fairly complex web application is too
          different form an ordinarily web site as many of the expectations they
          would have of desktop software are either inappropriate for a remote
          application with a browser client, or just cannot be delivered over
          HTTP. (web application design warrants a different mindset from desktop
          applications)

          On the other hand, maybe you could provide the user with an option to
          activate this facility. Say a checkbox labelled "Enter/Return acts as
          Tab" (or more explanatory) and let the user decide. You could store the
          user's preference, in a cookie or server-side (preferably, if possible)
          and have the value of the checkbox submitted with the form so you could
          monitor what users actually did (to decide whether 'on' or 'off' was the
          sensible default state for the checkbox (my money would be on 'off')).

          In any event, to avoid your problem you either need more specific event
          handlers attached to the individual input fields (and so not the
          textarea), or you need to look into event prorogation, phases and
          bubbling (Google / Google groups).
          [color=blue]
          > You're free to do it like the "standard"
          > says, but I'd rather make my users happy and collect my paycheck.[/color]

          Usenet also has standards, you should maybe familiarise yourself with
          them as failure to do so has consequnces.
          [color=blue]
          > "Thomas 'PointedEars' Lahn" ...[/color]
          <snip verbatim quote, posted over>

          <URL: http://jibbering.com/faq/#FAQ2_3 >

          Richard.


          Comment

          • Russell Campbell

            #6
            Re: onKeyDown question

            Consequences? I'm going to be banned (or whatever) for having a different
            opinion than someone else? I think threats are inappropriate. Differences
            of opinion are tolerated.

            Maybe the original responder, instead of just giving me a "never violate
            'standards'" answer, should have asked more about the situation, offered
            other suggestions (as you and another person did), and generally not been so
            presumptive that I was doing something wrong.

            This is a heavily number-intensive situation and the users have specifically
            asked for this. Additionally, it's not a public web site. I stick to
            industry "standards" , but I've been around long enough to know when it makes
            sense to throw them out.

            A "don't do it" answer was not helpful and just amounted to a lecture.
            That's why you detected some irritation in my response to the original
            responder. But if there are "consequenc es" for such a mild response (I've
            seen so much worse and I'm sure you have, too), then it will be a very sad
            day for USENET.


            "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message
            news:c9re2f$4s2 $1$8300dec7@new s.demon.co.uk.. .[color=blue]
            > Russell Campbell wrote:[color=green]
            > > So you think that rules should just be followed all the time without
            > > question? I find that many users want to use the Enter key to move
            > > between fields - *especially* when they are entering a bunch of
            > > numbers, which is what is happening here. Although I'm a Mac fan
            > > from way back, I think Apple's decision to put this in the Mac
            > > interface and Microsoft's decision to follow it was stupid. So I
            > > accomodate my users - who don't want this - instead of following
            > > rules like an automaton.[/color]
            >
            > In an Internet context the expectation of the majority of users will be
            > the normal behaviour of their web browser (whatever that may be).
            > Inexperienced browser users may miss particular GUI styles form other
            > application, and may even be vocal about it, but eventually (and
            > inevitably) they will become experienced browser users and themselves
            > have expectations based on normal browser behaviour. One of the main
            > factors that makes a GUI intuitive is that it rewards the expectations
            > of its users. It is also probably not a good idea to let the user get
            > the impression that even a fairly complex web application is too
            > different form an ordinarily web site as many of the expectations they
            > would have of desktop software are either inappropriate for a remote
            > application with a browser client, or just cannot be delivered over
            > HTTP. (web application design warrants a different mindset from desktop
            > applications)
            >
            > On the other hand, maybe you could provide the user with an option to
            > activate this facility. Say a checkbox labelled "Enter/Return acts as
            > Tab" (or more explanatory) and let the user decide. You could store the
            > user's preference, in a cookie or server-side (preferably, if possible)
            > and have the value of the checkbox submitted with the form so you could
            > monitor what users actually did (to decide whether 'on' or 'off' was the
            > sensible default state for the checkbox (my money would be on 'off')).
            >
            > In any event, to avoid your problem you either need more specific event
            > handlers attached to the individual input fields (and so not the
            > textarea), or you need to look into event prorogation, phases and
            > bubbling (Google / Google groups).
            >[color=green]
            > > You're free to do it like the "standard"
            > > says, but I'd rather make my users happy and collect my paycheck.[/color]
            >
            > Usenet also has standards, you should maybe familiarise yourself with
            > them as failure to do so has consequnces.
            >[color=green]
            > > "Thomas 'PointedEars' Lahn" ...[/color]
            > <snip verbatim quote, posted over>
            >
            > <URL: http://jibbering.com/faq/#FAQ2_3 >
            >
            > Richard.
            >
            >[/color]


            Comment

            Working...