Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    maxlength in pixels, instead of characters?

    Hello,

    Can something like "maxlength" be applied to a text field, in such a way that it limits text input to the width, in pixels, of the text box, rather than the number of characters that can be entered?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need some scripting for that:
    http://www.faqts.com/knowledge_base/...id/3579/fid/55

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    you also can just do:

    <input type="text" style="width: 400px;" name="mytext" />
    OracleGuy

  • #4
    New Coder
    Join Date
    Jan 2003
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That script seems to mimic maxlength, by limiting character input, but doesn't really define pixel width...

    thanks for the link, though.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Then combine the script with the CSS I posted above. Or is that not what you are going for?

  • #6
    New Coder
    Join Date
    Jan 2003
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you also can just do: <input type="text" style="width: 400px;" name="mytext" />
    The text field has style applied to it, but that doesn't seem to keep the text confined to that width.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •