Connecting Tech Pros Worldwide Forums | Help | Site Map

restrict characters in javascript prompt

vijay21@gmail.com
Guest
 
Posts: n/a
#1: Jul 23 '05
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
Guest
 
Posts: n/a
#2: Jul 23 '05

re: restrict characters in javascript prompt


In article <1112770711.113368.48360@o13g2000cwo.googlegroups. 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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Grant Wagner
Guest
 
Posts: n/a
#3: Jul 23 '05

re: restrict characters in javascript prompt


<vijay21@gmail.com> wrote in message
news:1112770711.113368.48360@o13g2000cwo.googlegro ups.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@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq


vijay21@gmail.com
Guest
 
Posts: n/a
#4: Jul 23 '05

re: restrict characters in javascript prompt


Thankyou all for the help.

Closed Thread