Reputation: 4343
I just have a quick question, im wondering if someone could help me.
I have the following script that someone has written which returns an error if there are no characters in the text field.
I want to modify the script so that it returns an error if there are less than 4 characters, but im not quite sure how.
Current script is as follows:
if(!isString($.trim(iUsername.val()))){ //If username is not correct
iUsername.siblings('.error').text('You must enter a username.');
error = true;
}
Upvotes: 2
Views: 9389