Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjriddle
    • CommentTimeNov 11th 2009
     permalink
    Hello cssBeauty,

    So I am doing some testing on our companies site and noticed a "bug" of sorts with the
    Webkit browsers (Safari/Chrome). I was wondering if anyone has a fix for this.

    Take the following.

    <input type="text" width="40" maxlength="3" name="foobarExample" value="foobar" />

    The text-field displays the following in these browsers.

    Firefox/IE(6-8)/Opera = "foobar"
    Safari/Chrome = "foo"

    I understand the logic in why it is doing this. I just don't know why Webkit decided to take
    the initial default value and apply the max length to it when no other browser does this.

    I would expect this to be a wide-known issue in the dev community, and I am sure there is
    a way to fix but no-one on the internet that I could find has stated a resolution. It was in
    a bug-tracker it looked like for Webkit. But it would have had to be there forever I
    imagine, so I don't see it getting fixed there anytime soon.

    Any help would be great!
    Jesse Riddle
  1.  permalink
    Maxlength specifies the maximum length (in characters) of an input field. If it's set to 3 then the input should be no longer than 3 characters. Webkit is just following the standard. Width is just a dimension, which has nothing to do with the amount of characters inside the input element.
    • CommentAuthorjriddle
    • CommentTimeNov 23rd 2009 edited
     permalink
    Just a heads up,

    I know why Webkit is only displaying "3" characters. I was technically looking for a solution to break Web-kit. So that a user can only enter 3-char length but the default value being longer. Not to sound like an ass, but I never mentioned the width having anything to do with the behavior of web-kit. Width was set to 40. Max-Length on the other hand deals with the length of Chars on an input.

    Thanks,
    Jesse R.
Add your comments
    Username Password
  • Format comments as (Help)