By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,627 Members | 1,781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,627 IT Pros & Developers. It's quick & easy.

restrict characters in javascript prompt

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11*********************@o13g2000cwo.googlegroups. com>, 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

Jul 23 '05 #2

P: n/a
<vi*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
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 <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #3

P: n/a
Thankyou all for the help.

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.