CFTextarea maxlength validation onblur

Here is a nifty little trick. If you have a cftextarea and you want to let users know when they have exceeded the length allowed in the database you can use the maxlength plus validation attributes. You can use validateat attribute to validate onblur, onSubmit, or atServer.

<cftextarea name="question" required="yes" rows="4" cols="40"
maxlength="100"
validateat="onBlur"
validate="maxlength"
message="Question must be less than 100 Characters">

Cup size   
Select size then click on coffee cup.
This entry was posted in Code, Coldfusion, Snippets. Bookmark the permalink.