3 <title>Validation Test</title>
4 $ValidationHelper.InstallScripts()
5 $ValidationHelper.SetSubmitOptions(true, true, false, 0)
8 <form method="post" id="demoForm" action="validate.rails" onsubmit="$ValidationHelper.GetValidationTriggerFunction()">
11 <legend>Basic stuff</legend>
12 <label for="Name">Name</label>
13 <input type="text" name="Name" id="Name" validators="blank" />
14 <label for="Password">Password</label>
15 <input type="password" name="Password" id="Password" validators="length|6" />
16 <label for="Email">Email</label>
17 <input type="text" name="Email" id="Email" validators="email|3" />
18 <label for="Email_Confirm">Email Confirm</label>
19 <input type="text" name="Email_Confirm" id="Email_Confirm" validators="equalto|Email" />
22 <legend>Logical test (all or none)</legend>
23 <label for="Business_Name">Business Name</label>
24 <input type="text" name="Business_Name" id="Business_Name" displayName="A Business Custom Name for a Business Man" validators="blank|bok" />
25 <label for="Business_Phone">Business Phone</label>
26 <input type="text" name="Business_Phone" id="Business_Phone" validators="phone|bok" />
27 <label for="Business_Address">Business Address</label>
28 <input type="text" name="Business_Address" id="Business_Address" validators="length|10|bok" />
29 <input type="hidden" name="Business_Info" validators="allornone|,|Business_Name,Business_Phone,Business_Address" />
34 <legend>Complex Date checking</legend>
35 <label for="Date_1">Date 1</label>
36 <input type="text" name="Date_1" id="Date_1" validators="date|mm/dd/yyyy|/|1|today" />
37 <label for="Date_2">Date 2</label>
38 <input type="text" name="Date_2" id="Date_2" validators="date|dd/mm/yyyy|-|3|Date_1" />
39 <label for="Date_3">Date 3</label>
40 <input type="text" name="Date_3" id="Date_3" validators="date|yyyy/mm/dd| |4|Date_2" />
43 <legend>Credit Cards</legend>
44 <label for="Credit_Card_Type">Credit Card Type</label>
45 <select name="Credit_Card_Type" id="Credit_Card_Type" validators="selecti|0,1,6,10" onblur="ChangeCCType(this)">
46 <option value="" selected="selected">Pick Your Card</option>
47 <option value="">---------------</option>
48 <option value="VISA">Visa</option>
49 <option value="MC">Master Card</option>
50 <option value="DISC">Discover</option>
51 <option value="AMEX">American Express</option>
52 <option value="">---------------</option>
53 <option value="DINERS">Diners Club</option>
54 <option value="ENROUTE">enRoute Card</option>
55 <option value="JCB">JCB Card</option>
56 <option value="">---------------</option>
57 <option value="Switch">Switch</option>
58 <option value="Delta">Delta</option>
59 <option value="Solo">Solo</option>
61 <label for="Credit_Card_Number">Credit Card Number</label>
62 <input type="text" name="Credit_Card_Number" id="Credit_Card_Number" validators="cc|bok" />
67 <legend>Textarea</legend>
68 <label for="Comments">Comments</label>
69 <textarea name="Comments" id="Comments" validators="length|10|100"></textarea>
72 <div class="formFooter">
73 <input type="reset" name="Reset" value="Reset" onclick="this.form.Submit.disabled=false;" />
74 <input type="submit" name="Submit" value="Try it" />