473,378 Members | 1,688 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,378 software developers and data experts.

Blocking input into a text area

I wrote a script that tracks the number of characters a user types
into a text box. It has a limit you can set, and when that limit is
reached I would like to block the user from entering any more text.

How can I block the user from typing characters in the text area?

Apr 29 '07 #1
2 2098
eg****@gmail.com wrote:
I wrote a script that tracks the number of characters a user types
into a text box. It has a limit you can set, and when that limit is
reached I would like to block the user from entering any more text.

How can I block the user from typing characters in the text area?
There is no reliable way prevent the entry of characters using script.
There are some scripts which, once the limit has been reached, try to
detect on keydown if a character within a certain range has been
pressed and cancel it. However you have to allow users use of cursor
keys, delete, backspace, etc.

In any case, that method doesn't stop users entering as much text as
they like by pasting.

Your best bet is to validate the content when the form is submitted and
tell the user that they've put too many characters in the text area.
You might also have a keyup handler that shows the users how many
characters they have left.

Make sure your server can handle getting any number of characters from
the text area.
--
Rob
Apr 29 '07 #2
On Apr 29, 4:31 am, "egg...@gmail.com" <egg...@gmail.comwrote:
I wrote a script that tracks the number of characters a user types
into a text box. It has a limit you can set, and when that limit is
reached I would like to block the user from entering any more text.

How can I block the user from typing characters in the text area?
all been dealt with in this ng under the title Textarea on april 26

Apr 29 '07 #3

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

Similar topics

4
by: Jonathan Fine | last post by:
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine...
3
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in...
3
by: Otac0n | last post by:
This seems to be an impossible task, but here goes: Im looking for a C++ stl non-blocking input routine. I would normally be able to whip one up myself, if the STL functions were behaving in...
13
by: crjunk | last post by:
Should I expect some of my users to not be able to view a report that I am launching in a new web browser if they have any popup blocking tool bars or other software installed on their computer? ...
3
by: aurora | last post by:
This is an entry I just added to ASPN. It is a somewhat novel technique I have employed quite successfully in my code. I repost it here for more explosure and discussions. ...
1
by: guy.flowers | last post by:
Hi Have a problem, Ill give some history to the problem and add a little example code to start with to see if anybody can help or if I am correct in what the problem is. I have been looking...
0
by: RateTheBuilder | last post by:
Hi I found the below scripts which are used to dynamically resize the height of the text area input control. The site I found it on www.webdeveloper.com had it being called with the following...
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
12
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.