View Single Post
Old 10-03-2012, 01:43 AM   PM User | #1
arfa
New Coder

 
Join Date: Sep 2006
Posts: 51
Thanks: 1
Thanked 0 Times in 0 Posts
arfa is an unknown quantity at this point
limit character input (by count) with : in textarea name

I have a nice js character limit script I have used for a long time with no problem.
Code:
function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else { limitCount.value = limitNum - limitField.value.length; }}
I now have a form processor that has a naming system
Code:
textarea name=5)MIN:TXT:message
the element trigger looks like
Code:
<textarea name=5)MIN:TXT:message cols=40 rows=14 
onKeyDown=\"limitText(this.form.5)MIN:TXT:message,this.form.countdown,10);\"
onKeyUp=\"limitText(this.form.5)MIN:TXT:message,this.form.countdown,10);\">$value[5]</textarea>
And the limit script baulks at the characters ) : in the name.

I have tried quotes, escaped quotes and characters and various incantations but can't seem to convince it to work.

Any suggested fix on this one - or pointers to another similar script that will cope with this naming system.

thanks
arfa is offline   Reply With Quote