IE9 textarea Problem

Discussion in 'HTML' started by Gene Wirchenko, Dec 29, 2011.

  1. Dear HTMLers:

    I am working on a test page.

    I have some code which adjusts the value of a textarea control
    value. It eliminates extraneous spaces and newlines. This is done in
    the onblur event. The correct value gets calculated and appears to be
    assigned just fine.

    The weirdness is that the arrow keys then do not work properly.
    Repeated left arrows on some lines (bottom and close?) result in the
    cursor going to the left THEN back to the end of the same line.

    But it is not my code as I even see the weirdness before the
    onblur code is executed.

    The textarea is three rows high, and my values are longer than
    that.

    I have found that, if I add
    onfocus="this.select;"
    to the textarea control definition, it gets rid of the problem. This
    comes at the expense of not being able to click right at a point in
    the textarea to start modifying.

    Have I found a bug? Is there a way around this?

    Sincerely,

    Gene Wirchenko
     
    Gene Wirchenko, Dec 29, 2011
    #1
    1. Advertising

  2. Gene Wirchenko <> wrote

    > Dear HTMLers:
    >
    > I am working on a test page.
    >
    > I have some code which adjusts the value of a textarea control
    > value. It eliminates extraneous spaces and newlines. This is done in
    > the onblur event. The correct value gets calculated and appears to be
    > assigned just fine.


    Please understand this will not work for users who have JavaScript
    disabled. Never trust anything from the client, always check server
    side, especially before passing values to a database.

    >
    > The weirdness is that the arrow keys then do not work properly.
    > Repeated left arrows on some lines (bottom and close?) result in the
    > cursor going to the left THEN back to the end of the same line.
    >
    > But it is not my code as I even see the weirdness before the
    > onblur code is executed.
    >
    > The textarea is three rows high, and my values are longer than
    > that.
    >
    > I have found that, if I add
    > onfocus="this.select;"
    > to the textarea control definition, it gets rid of the problem. This
    > comes at the expense of not being able to click right at a point in
    > the textarea to start modifying.
    >
    > Have I found a bug? Is there a way around this?
    >


    As always, a URL would be very helpful. If you do not have a URL, check
    with your ISP, a lot of them give free web space out, or check with one
    of the free hosting services. If there is sensitive information, remove
    it, and then publish it.

    Some other things to do:

    1. Validate the markup and the CSS
    2. Test in other browsers and note their behaivor

    --
    Adrienne Boswell
    Arbpen Web Site Design Services - http://www.cavalcade-of-coding.info/
    The Good Plate - Fresh Gourmet Recipes - http://the-good-plate.com/
    Please respond to the group so others can share
     
    Adrienne Boswell, Dec 29, 2011
    #2
    1. Advertising

  3. On Thu, 29 Dec 2011 08:07:50 +0000 (UTC), Adrienne Boswell
    <> wrote:

    >Gene Wirchenko <> wrote
    >
    >> Dear HTMLers:
    >>
    >> I am working on a test page.
    >>
    >> I have some code which adjusts the value of a textarea control
    >> value. It eliminates extraneous spaces and newlines. This is done in
    >> the onblur event. The correct value gets calculated and appears to be
    >> assigned just fine.

    >
    >Please understand this will not work for users who have JavaScript
    >disabled. Never trust anything from the client, always check server
    >side, especially before passing values to a database.


    This will be part of an internal app. JavaScript will be
    enabled.

    Yes, I do not trust, but I still want a good front-end for the
    good users. I will validate as in belt and suspenders.

    >> The weirdness is that the arrow keys then do not work properly.
    >> Repeated left arrows on some lines (bottom and close?) result in the
    >> cursor going to the left THEN back to the end of the same line.
    >>
    >> But it is not my code as I even see the weirdness before the
    >> onblur code is executed.
    >>
    >> The textarea is three rows high, and my values are longer than
    >> that.
    >>
    >> I have found that, if I add
    >> onfocus="this.select;"
    >> to the textarea control definition, it gets rid of the problem. This
    >> comes at the expense of not being able to click right at a point in
    >> the textarea to start modifying.
    >>
    >> Have I found a bug? Is there a way around this?
    >>

    >
    >As always, a URL would be very helpful. If you do not have a URL, check
    >with your ISP, a lot of them give free web space out, or check with one
    >of the free hosting services. If there is sensitive information, remove
    >it, and then publish it.


    I do not want to add yet another variable. Here is some basic
    code that can replicate the problem. I state "can", because I still
    do not have a 100% lock on what causes the problem.

    ***** Start of Code *****
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>textarea Problem</title>

    </head>

    <body>

    <textarea cols=40 rows=3></textarea>

    </body>

    </html>
    ***** End of Code *****

    I do not have an always fails with, always succeeds with, but the
    following reliably fails on my system (IE 9 & Windows 7):

    Start the page.
    Click on the textarea control.
    Type "The quick,<brown fox<jumps over<the lazy<dog.<" where "<"
    means <Enter>.
    Press <left-arrow>. The cursor moves to just after the period in
    "dog.".
    Press <left-arrow> four times. The cursor moves to the beginning
    of the line "dog.".
    Press <left-arrow> again. The cursor move to the end of the
    "dog." line rather than the end of the "the lazy" line.

    This works in Firefox 9.0.1 on Windows XP.

    Sincerely,

    Gene Wirchenko
     
    Gene Wirchenko, Dec 29, 2011
    #3
  4. 2011-12-29 22:08, Gene Wirchenko wrote:

    > This will be part of an internal app. JavaScript will be
    > enabled.


    You originally described the issue as a JavaScript problem, and now you
    seem to confirm this. Yet, the example you give is pure HTML with no
    scripting.

    > Yes, I do not trust, but I still want a good front-end for the
    > good users. I will validate as in belt and suspenders.


    I have no argument about that. But you originally wrote about
    elimination of "extraneous spaces and newlines", and I cannot see that
    as validation.

    > Here is some basic
    > code that can replicate the problem.


    I tested a verbatim copy of the code on IE 9.0.8112.16421 on Windows 7
    Pro and did not see anything like the problem you describe as occurring
    "reliably".

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Dec 29, 2011
    #4
  5. On Thu, 29 Dec 2011 22:38:26 +0200, "Jukka K. Korpela"
    <> wrote:

    >2011-12-29 22:08, Gene Wirchenko wrote:
    >
    >> This will be part of an internal app. JavaScript will be
    >> enabled.

    >
    >You originally described the issue as a JavaScript problem, and now you
    >seem to confirm this. Yet, the example you give is pure HTML with no
    >scripting.


    I stated that I ran into it with JavaScript and then found it to
    be so in straight HTML, too.

    >> Yes, I do not trust, but I still want a good front-end for the
    >> good users. I will validate as in belt and suspenders.

    >
    >I have no argument about that. But you originally wrote about
    >elimination of "extraneous spaces and newlines", and I cannot see that
    >as validation.


    Well, I do. Neatness counts.

    Some validations can be forced. For example, a Canadian Postal
    Code has uppercase alphabetics, and applying String's .toUpperCase()
    to it is a way of ensuring validity. Extraneous spaces and newlines
    can be wrong, too.

    > > Here is some basic
    >> code that can replicate the problem.

    >
    >I tested a verbatim copy of the code on IE 9.0.8112.16421 on Windows 7
    >Pro and did not see anything like the problem you describe as occurring
    >"reliably".


    Did you do exactly what I stated? I also stated that I did not
    have the problem totally identified, but that I had a case that always
    gave the problem. I have also had similar things not fail that way.

    Sincerely,

    Gene Wirchenko
     
    Gene Wirchenko, Dec 29, 2011
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris F.A. Johnson

    IE9

    Chris F.A. Johnson, Apr 1, 2009, in forum: HTML
    Replies:
    3
    Views:
    523
  2. cwdjrxyz
    Replies:
    2
    Views:
    816
    Beauregard T. Shagnasty
    Sep 24, 2010
  3. P E Schoen
    Replies:
    0
    Views:
    652
    P E Schoen
    Mar 7, 2012
  4. Garrett Smith

    Microsoft and IE9 New Features

    Garrett Smith, Mar 16, 2010, in forum: Javascript
    Replies:
    33
    Views:
    530
    Dr J R Stockton
    Mar 22, 2010
  5. carousel and IE9 problem

    , Apr 29, 2011, in forum: Javascript
    Replies:
    4
    Views:
    481
Loading...

Share This Page