validation - Custom ValidationTextBox in Dojo -
i new dojo programming , trying create validationtextbox username input. have 3 criteria: 1. users can input alphanumeric characters , 2. minimum length of username 6 character 3. field required
so far input looks like:
<input name="username" type="text" id="username" class="reqd1" required="true" trim="true" lowercase="true" promptmessage="username" invalidmessage="please enter alphanumeric characters." maxlength="12" regexp="[\w]+" intermediatechanges="false" dojotype="dijit.form.validationtextbox" />
i have 3 questions: 1. how can check the minimum character of username field? 2. there way change invalidmessage programatically? 3. how can check length of username field without using regex?
- regexp="\w{6,12}"
- dijit.byid("username").set("invalidmessage", "new message");
- i think regexp best way in case
Comments
Post a Comment