Below is the code from a post that Jane posted for 5.2 on limiting input in a text area field and a counter to display the amount of characters entered. Is there any updated code for 7.2?
Code entered in Edit ->Jacascript onload event. FieldName = your field
var ctrlFieldName = Runner.getControl(pageid, 'FieldName');
document.getElementById('counter').value = ctrlFieldName.getValue().length;
function func()
{
//update counter
document.getElementById('counter').value = ctrlFieldName.getValue().length;
//check if length of the entered value <40 characters
if (ctrlFieldName.getValue().length>40)
{
//show first 40 characters only
ctrlFieldName.setValue(ctrlFieldName.getValue().substr(0,40));
//update counter
document.getElementById('counter').value = 40;
}
}
ctrlFieldName.on('keyup', func);
Counter (entered after text field)
<input type=text value=0 id=counter disabled="disabled" size=3>