This patch applys some basic javascript to validate that a date entered is
at least in ISO 8601 format. This prevents someone from entering "cupcake"
or 55/66/6666 as a valid date of birth by validating the stgu.dob input
at the time of submission.
Signed-off-by: Michael Peters <mpeters@emeralddata.net>
# The dojo date widget in the patron edit UI only accepts default
# values in ISO8601 format. It will not accept locale-shaped dates.
IF !ctx.register.settings.stgu.dob.example;
- ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD');
+ ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD or YYYY/MM/DD');
END;
%]
) | html %]</h4>
[% END %]
- <form method='POST'>
+ <form method='POST' onSubmit="return dobValidate(document.getElementById('stgu.dob'))">
<table>
<tr>
<td>
</td>
<td>
<input
- type='text'
+ type='text'
+ id='[% field_path %]'
name='[% field_path %]'
value='[% value || CGI.param(field_path) | html %]'/>
[% IF require %]