473,498 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

textarea limiter not working

Hi

Can some kind soul(s) review my stripped-down html below and advise me
on why it doesn't work? All I get when I enter text in the form is the
ubiquitous "Error on page" at the bottom of the browser.

For the life of me, I can't see why it doesn't work :- it's gotta be
something simple, surely?

As ever, all help gratefully received

Cheers

Bill

---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>counter</title>

<script language="JavaScript" type="text/javascript">
<!--
function CText(CField, CCount, Climit) {
if (CField.value.length > Climit) {
CField.value = CField.value.substring(0, Climit);
} else {
CCount.value = Climit - CField.value.length;
}
}
//-->
</script>

</head>
<body>

<form method="post" action="test.html">
<textarea rows="15" name="body" cols="75" wrap="physical"
onKeyDown="CText(this.form.body,this.form.total,10 0);"
onKeyUp="CText(this.form.body,this.form.total,100) ;"></textarea>
</form>

</body>
</html>

Mar 29 '06 #1
2 1049
Excellent! I just knew it had to be something simple (looking so hard I
couldn't see the wood for the trees - or vice versa or sumfin')

Great tip about firefox - I should indeed be using it more anyway...

Many thanks

Bill

Mar 30 '06 #2
wrote on 30 mrt 2006 in comp.lang.javascript:
Excellent! I just knew it had to be something simple (looking so hard I
couldn't see the wood for the trees - or vice versa or sumfin')

Great tip about firefox - I should indeed be using it more anyway...


Please quote what you are replying to. If you want to post a followup via
groups.google.com, don't use the "Reply" link at the bottom of the article.
Click on "show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
<http://www.safalra.com/special/googlegroupsreply/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 30 '06 #3

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

Similar topics

4
9298
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains several cards, in a card layout, which are...
0
947
by: Samir Patel | last post by:
Hi I am using Textarea type.I want to set maximum length to the textarea. I am using following code for the same,but it is not working, <textarea name="txtDescription" cols=10 rows=3...
1
1764
by: Samir Patel | last post by:
Hi I am using Textarea type.I want to set maximum length to the textarea. I am using following code for the same,but it is not working, <textarea name="txtDescription" cols=10 rows=3...
0
970
by: Samir Patel | last post by:
Hi I am using Textarea type.I want to set maximum length to the textarea. I am using following code for the same,but it is not working, <textarea name="txtDescription" cols=10 rows=3...
4
4221
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
19
7899
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
1
4476
by: Garry Jones | last post by:
I have been using this code for sometime. I can use it to show the user how many remaining characters are reamaining in a text area. Now I need to develop the code and dont know where to start. ...
3
5619
by: FunkHouse9 | last post by:
I'm working on a form to collect data in a textarea which and am trying to keep returns and spaces. I have a couple of functions that I Frankensteined together to replace returns with <br> and to...
1
2631
by: nubster21 | last post by:
I would like to split a string of HTML output into an array on textarea tags. Example: <div>Hello this is my content <textarea>foo</textareaand this is also content <b>some bold...
0
7124
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
7163
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
7200
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...
1
6884
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...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
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...
0
287
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...

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.