restrict characters in javascript prompt

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vijay21@gmail.com

    restrict characters in javascript prompt

    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

  • kaeli

    #2
    Re: restrict characters in javascript prompt

    In article <1112770711.113 368.48360@o13g2 000cwo.googlegr oups.com>, vijay21
    @gmail.com enlightened us with...[color=blue]
    > 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[/color]


    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.



    Comment

    • Grant Wagner

      #3
      Re: restrict characters in javascript prompt

      <vijay21@gmail. com> wrote in message
      news:1112770711 .113368.48360@o 13g2000cwo.goog legroups.com...[color=blue]
      > 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.[/color]

      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 <gwagner@agrico reunited.com>
      comp.lang.javas cript FAQ - http://jibbering.com/faq


      Comment

      • vijay21@gmail.com

        #4
        Re: restrict characters in javascript prompt

        Thankyou all for the help.

        Comment

        Working...