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?

  1. regexp="\w{6,12}"
  2. dijit.byid("username").set("invalidmessage", "new message");
  3. i think regexp best way in case

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -