restrict characters in javascript prompt

Discussion in 'Javascript' started by vijay21@gmail.com, Apr 6, 2005.

  1. Guest

    hi all,

    Can we restrict the number of characters that the user can input in a
    javascript prompt? my browser hangs whenever i try to input more than
    2048 characters in it.

    Thanks for any help
    , Apr 6, 2005
    #1
    1. Advertising

  2. kaeli Guest

    In article <>, vijay21
    @gmail.com enlightened us with...
    > hi all,
    >
    > Can we restrict the number of characters that the user can input in a
    > javascript prompt? my browser hangs whenever i try to input more than
    > 2048 characters in it.
    >
    > Thanks for any help



    I'm not sure, but if people are entering that many characters, why are you
    using a prompt at all?
    I would think a text field or a textarea might be more useful for the users
    so they can actually see what they're entering.
    And I do know how to limit those. :)

    --
    --
    ~kaeli~
    She was engaged to a boyfriend with a wooden leg but broke
    it off.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Apr 6, 2005
    #2
    1. Advertising

  3. Grant Wagner Guest

    <> wrote in message
    news:...
    > hi all,
    >
    > Can we restrict the number of characters that the user can input in a
    > javascript prompt? my browser hangs whenever i try to input more than
    > 2048 characters in it.


    No you can't. If you want arbitrary input from the user, use a <form>
    and have them submit the form to either client- (using GET, the amount
    of data you could submit will most likely be 1500-2000 characters) or
    server-side (using POST, the amount of data is limited only by the
    server's POST buffer restrictions) code.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Apr 7, 2005
    #3
  4. Guest

    Thankyou all for the help.
    , Apr 9, 2005
    #4
    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. Anil Mamede
    Replies:
    2
    Views:
    425
    Anil Mamede
    Apr 6, 2008
  2. gaurav kashyap
    Replies:
    2
    Views:
    613
    gaurav kashyap
    Oct 30, 2008
  3. gaurav kashyap
    Replies:
    3
    Views:
    683
    gaurav kashyap
    Oct 31, 2008
  4. Mel
    Replies:
    10
    Views:
    3,116
    Sailaja Appi
    Feb 13, 2009
  5. Sharkie
    Replies:
    6
    Views:
    519
    Sharkie
    Oct 16, 2007
Loading...

Share This Page