473,761 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2503
In article <11************ *********@o13g2 000cwo.googlegr oups.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******** *************@o 13g2000cwo.goog legroups.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*****@agrico reunited.com>
comp.lang.javas cript 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
2886
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 -*- .... because of the presence of non-ASCII characters. When I write a script like the folowing:
2
1349
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 Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.usenet.com
3
2562
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
1350
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 it should prompt to the user to download again from the site. Can anyone guide me in this.
4
1934
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. The spinning prompt should spin continuously. so far I have: <script>
1
1930
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
11338
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: function test() { var sValue="short unusuallyLongAndWayTooLongString short2"; var regEx=/\S{10,}/; return regEx.test(sValue);
3
2638
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
1807
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 accept arabic word from user & the direction of prompt input box should be right to left. how to do this ? Its very Urgent...!!! Please help me.........
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.