...
ConfiForms Form Definition | ||
---|---|---|
| ||
HTML |
---|
<script> function addCounter(formName, formId) { var taElem = AJS.$('#' + formId).find('#i_ta'); if (!taElem.hasClass('cfcounter')) { taElem.addClass('cfcounter'); taElem.on("input", function(){ var maxlength = 10; var currentLength = AJS.$(this).val().length; if( currentLength >= maxlength ){ console.log("You have reached the maximum number of characters."); }else{ console.log(maxlength - currentLength + " chars left"); } }); } } </script> |