473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

Jul 23 '05 #1
3 2466
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
<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
Thankyou all for the help.

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sebb | last post by:
For information, I have windows xp (english edition). When I use special non-english characters (like é à è ...) in my python code, IDLE tells me to add a line like: # -*- coding: cp1252 -*- ...
2
by: atif | last post by:
I hav a prob with the textfield i want to restrict this field so that only integer values should b entered e.g 0-9 n no english or special characters should b entered in the text field Posted...
3
by: divaof_7 | last post by:
I've a textbox field, where user enters his name. I want to restrict him from entering double and singls inverted commas.What kind of function should i write.
2
by: sudhaoncyberworld | last post by:
Hi Techies, I have created Setup & Deployment project and installing a windows application from that. Now i want to restrict the user to install my application only upto 3 times. After that...
4
by: dgiff33 | last post by:
Hello I am trying to display the characters |, /, - and \ one after the other in the same spot, disappearing and being replaced by the next character so that it looks like a spinning prompt. ...
1
by: =?Utf-8?B?Qw==?= | last post by:
I want to restrict the user entering nonalphanumeric keys using Javascript onKeypress. One exception is that I want to allow the user to enter spaces. How can I do this? Thanks in Advance.
7
by: Sharkie | last post by:
I need a regular expression which will evaluate to false if number of consecutive characters (non-whitespace) exceeds certain number (10 in this example). For example, I have this function: ...
3
by: Anil Mamede | last post by:
Hi, I'm having an hard time to build a regular expression that: - Will accept words; - Will accept spaces; - But cannot accept digits; Examples: This is a game
1
by: Aslesha | last post by:
Hi, I am developing a website supporting Arabic language. The direction of all input types I used is right to left. ( using dir attribute ) but the problem is with javascript prompt. I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.