Tenon Intersystems Please see text links at bottom of page for navigation
Please see text links at bottom of page for navigation

Search tenon.com

Thanks to:

WebTen

Re: HTML question

To: webten@xxxxxxxxxxxxxxx
Subject: Re: HTML question
From: sergio aghemo <s.aghemo@xxxxxx>
Date: Tue, 23 Jan 2001 11:41:10 +0100

My question is: is it possible to limit the number of characters with a TEXTAREA (i.e. multi-line text box)? If so, what are the attributes I need to add. I really want an HTML solution rather than having to limit it within a CGI as I don't know how to write such a script.

No, on my knowledge. I use a simple javascrit to do this task; It looks like:



// count the available char before a max number of char //usage: onKeyup="calcCharLeft(this,###)" onFocus="calcCharLeft(this,###)" function calcCharLeft(Target,maxChar) { StrLen = Target.value.length;

if (StrLen > maxChar ) {
Target.value = Target.value.substring(0,maxChar)
CharsLeft = 0
window.alert("Lunghezza stringa eccessiva di: " + (StrLen-maxChar) + " carattere/i");
} else {
CharsLeft = maxChar - StrLen
}


document.forms[0].charsleft.value = maxChar - Target.value.length

}



in the HTML form use:

<TEXTAREA NAME="textImput" ROWS="4" COLS="40" onKeyup="calcCharLeft(this,100)" onFocus="calcCharLeft(this,100)">

</TEXTAREA>
--
Sergio Aghemo
--
The Web is exciting for two reasons. One, it's ubiquitous. Two, I don't think
Microsoft will figure out a way to own it.
                                                                 - Steve Jobs

----
Tenon Intersystems' WebTen Mailing List
To unsubscribe: send mail to webten-request@xxxxxxxxx with the subject: unsubscribe
Find searchable Mailing List archives at
http://listsearch.blueworld.com/webtensearch.lasso


<Prev in Thread] Current Thread [Next in Thread>

| Tenon Home | Products | Order | Contact Us | About Tenon | Register | Tech Support | Resources | Press Room | Mailing Lists |

Powered By iTools

Copyright©2003 Tenon Intersystems, 232 Anacapa Street, Suite 2A, Santa Barbara, CA 93101. All rights reserved.
Questions about our website - Contact: webmaster@tenon.com.


Tenon Home  Tenon Home  Tenon Home  Tenon Home Product Info  Tenon Ordering Contact About Register Support Resources Press Mailing Lists