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. Advertisements

  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. Advertisements

  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. Advertisements

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. Weston Weems

    Javascript onunload to prompt saving info

    Weston Weems, Nov 17, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    27,454
    Weston Weems
    Nov 17, 2004
  2. sebb
    Replies:
    3
    Views:
    432
  3. Anil Mamede
    Replies:
    2
    Views:
    515
    Anil Mamede
    Apr 6, 2008
  4. gaurav kashyap
    Replies:
    2
    Views:
    832
    gaurav kashyap
    Oct 30, 2008
  5. gaurav kashyap
    Replies:
    3
    Views:
    882
    gaurav kashyap
    Oct 31, 2008
  6. Mel
    Replies:
    10
    Views:
    3,541
    Sailaja Appi
    Feb 13, 2009
  7. chris
    Replies:
    2
    Views:
    214
    kaeli
    Nov 10, 2003
  8. Sharkie
    Replies:
    6
    Views:
    744
    Sharkie
    Oct 16, 2007
Loading...