Lines 166-195
$(document).ready(function(){
Link Here
|
166 |
|
166 |
|
167 |
|
167 |
|
168 |
<script type="text/javascript"> |
168 |
<script type="text/javascript"> |
169 |
var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); |
169 |
var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); |
170 |
var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); |
170 |
var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); |
171 |
var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period.")); |
171 |
var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period.")); |
172 |
var MSG_DESCRIPTION_LETTERS_ONLY=(_("Please only enter letters.")); |
|
|
173 |
</script> |
172 |
</script> |
174 |
|
173 |
|
175 |
<script type="text/javascript"> |
174 |
<script type="text/javascript"> |
176 |
jQuery.validator.addMethod( "category_code_check", function(value,element){ |
175 |
jQuery.validator.addMethod( "category_code_check", function(value,element){ |
177 |
var patt = /^[A-Za-z]{0,10}$/g; |
176 |
var patt = /[0-9A-Za-z]{1,10}$/g; |
178 |
if (patt.test(element.value)) { |
177 |
if (patt.test(element.value)) { |
179 |
return true; |
178 |
return true; |
180 |
} else { |
179 |
} else { |
181 |
return false; |
180 |
return false; |
182 |
} |
181 |
} |
183 |
}, MSG_CATEGORYCODE_CHARS |
182 |
}, MSG_CATEGORYCODE_CHARS |
184 |
); |
|
|
185 |
jQuery.validator.addMethod( "letters_only", function(value,element){ |
186 |
var patt =/^[A-Za-z ]{0,30}$/g; |
187 |
if (patt.test(element.value)){ |
188 |
return true; |
189 |
} else { |
190 |
return false; |
191 |
} |
192 |
}, MSG_DESCRIPTION_LETTERS_ONLY |
193 |
); |
183 |
); |
194 |
|
184 |
|
195 |
jQuery.validator.addMethod( "enrollment_period", function(){ |
185 |
jQuery.validator.addMethod( "enrollment_period", function(){ |
Lines 221-227
$(document).ready(function() {
Link Here
|
221 |
}, |
211 |
}, |
222 |
description: { |
212 |
description: { |
223 |
required:true, |
213 |
required:true, |
224 |
letters_only: true |
|
|
225 |
}, |
214 |
}, |
226 |
enrolmentperiod: { |
215 |
enrolmentperiod: { |
227 |
required: function(element){ |
216 |
required: function(element){ |
Lines 235-241
$(document).ready(function() {
Link Here
|
235 |
return $("#enrolmentperiod").val() === ""; |
224 |
return $("#enrolmentperiod").val() === ""; |
236 |
}, |
225 |
}, |
237 |
enrollment_period: true, |
226 |
enrollment_period: true, |
238 |
// is_valid_date ($(#"enrolementperioddate").val()); |
|
|
239 |
}, |
227 |
}, |
240 |
dateofbirthrequired: { |
228 |
dateofbirthrequired: { |
241 |
digits: true |
229 |
digits: true |
Lines 254-259
$(document).ready(function() {
Link Here
|
254 |
} |
242 |
} |
255 |
}, |
243 |
}, |
256 |
messages: { |
244 |
messages: { |
|
|
245 |
categorycode: { |
246 |
required: MSG_CATEGORYCODE_CHARS |
247 |
}, |
257 |
enrolmentperiod: { |
248 |
enrolmentperiod: { |
258 |
required: MSG_ONE_ENROLLMENTPERIOD |
249 |
required: MSG_ONE_ENROLLMENTPERIOD |
259 |
}, |
250 |
}, |
Lines 319-331
$(document).ready(function() {
Link Here
|
319 |
<ol> |
310 |
<ol> |
320 |
<li> |
311 |
<li> |
321 |
<label for="categorycode" class="required">Category code: </label> |
312 |
<label for="categorycode" class="required">Category code: </label> |
322 |
<input type="text" pattern="^[A-Za-z]{0,10}$" title="Please enter 1 or 2 capital letters" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> |
313 |
<input type="text" pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" id="categorycode" name="categorycode" value="[% category.categorycode %]" size="10" maxlength="10" class="required" required="required" /> |
323 |
<span class="required">Required</span> |
314 |
<span class="required">Required</span> |
324 |
</li> |
315 |
</li> |
325 |
|
316 |
|
326 |
<li> |
317 |
<li> |
327 |
<label for="description" class="required">Description: </label> |
318 |
<label for="description" class="required">Description: </label> |
328 |
<input type="text" pattern="[a-zA-Z ]+" title="Please enter a description sentence of letters only" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" /> |
319 |
<input type="text" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html%]" /> |
329 |
<span class="required">Required</span> |
320 |
<span class="required">Required</span> |
330 |
</li> |
321 |
</li> |
331 |
|
322 |
|