I have the following html code:
<div class="result hide" id="userNameTooShort"><span class="error">Your username needs to be six characters long.</span></div>
I want this to display when a user types less than 6 characters in the username input field. The hide class displays none if it is valid.
Here is the input field I created in javascript:
createFieldObjects: function(){
unField = new forms.InputField("tUserName", /^(?=.*[a-zA-Z\d])(\w|[\.\@\-\?\,\&\''\/\_\""]){6,}$/);
},
How do I write the javascript to display the error message when the user types less than 6 characters?
In a prototype/pseudocode way: