arfa
10-03-2012, 01:43 AM
I have a nice js character limit script I have used for a long time with no problem.
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
textarea name=5)MIN:TXT:message
the element trigger looks like
<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
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
textarea name=5)MIN:TXT:message
the element trigger looks like
<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