One way to do this is to use the keydown event in javascript.
Put this in the HTML other properties box of the editable field "fl_Comments".
onKeyDown="limitText(this.form.fl_Comments,this.form.countdown,34);" onKeyUp="limitText(this.form.fl_Comments,this.form.countdown,34);" maxlength="34"
Put this function in the JSHeader section:
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
Have an editable field called limitField with
default formula:
@Text(34-@Length(fl_comments))
and style:
border:0px;
NB Using keypress event has weird results when using delete key so beware.