This is an old revision of the document!
Here's a quick way to limit the length of customer comments on your invoices using javascript. Essentially, this is just a script to limit the size of a <textarea> element.
in both includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_shipping_default.php and includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_payment_default.php
find this line
<?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
and insert BENEATH it
Max 140 Characters (<div style="display:inline" id="charCount">140</div> remain) <script> comments = document.getElementsByName("comments")[0]; comments.onkeydown = commentstuff; comments.onkeypress = commentstuff; comments.onkeyup = commentstuff; comments.onblur = commentstuff; comments.onfocus = commentstuff; comments.onclick = commentstuff; comments.onselect = commentstuff; function commentstuff(){ if (comments.value.length > 140) { comments.value = comments.value.substring(0, 140); } remain = 140 - comments.value.length; document.getElementById('charCount').innerHTML = remain; } remain = 140 - comments.value.length; document.getElementById('charCount').innerHTML = remain; </script>