<form name=a validation="
-general no_confirm: 1
-general no_alert: 1
-general as_array_prefix: ' -- '
+group onevent: 'submit,change'
+group no_confirm: 1
+group no_alert: 1
+group as_array_prefix: ' -- '
">
-<table>
+<table border=0>
<tr>
- <td valign=top>Enter a date (YYYY/MM/DD) greater than today:<br>
+ <td colspan=2 valign=top>Enter a date (YYYY/MM/DD) greater than today:<br>
(<script>var t=new Date();document.writeln(t.toGMTString())</script>)
</td>
- <td>
+</tr>
+<tr>
+ <td width=100>
<input type=text size=20 name=date validation="
name: Date
required: 1
+ order: ['match','custom_js']
match: 'm|^\d\d\d\d/\d\d/\d\d$|'
match_error: 'Please enter date in YYYY/MM/DD format'
custom_js: |
function (args) {
+ if (args.errors.length) return 1;
var t=new Date();
var y=t.getYear()+1900;
var m=t.getMonth() + 1;
var d=t.getDate();
if (m<10) m = '0'+m;
if (d<10) d = '0'+d;
- (args.value > ''+y+'/'+m+'/'+d) ? 1 : 0;
+ return (args.value > ''+y+'/'+m+'/'+d) ? 1 : 0;
}
custom_js_error: The date was not greater than today.
-"><br>
- <span id=date_error class=error></span>
+">
</td>
+ <td><span id=date_error class=error></span></td>
</tr>
<tr>
- <td colspan=2 align=right>
+ <td align=right>
<input type=submit>
</td>
+ <td> </td>
</tr>
</table>
</form>