1 jQuery.validator.addMethod( "letters_numbers", function(value,element){
2 var patt = /^[a-zA-Z0-9\-_]+$/g;
3 if (patt.test(element.value)) {
8 }, MSG_CATEGORYCODE_CHARS
11 jQuery.validator.addMethod( "enrollment_period", function(){
12 enrolmentperiod = $("#enrolmentperiod").val();
13 enrolmentperioddate = $("#enrolmentperioddate").val();
14 if ( $("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "" ) {
19 }, MSG_ONE_ENROLLMENTPERIOD
23 $(document).ready(function() {
24 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
30 "aTargets": [3, 4, 5],
36 "sPaginationType": "four_button"
39 $("#enrolmentperioddate").datepicker({
41 }); // Require that "until date" be in the future
43 if ($("#branches option:selected").length < 1) {
44 $("#branches option:first").attr("selected", "selected");
47 $("#categorycode").on("blur",function(){
51 $("#category_form").validate({
57 description: "required",
59 required: function(element){
60 return $("#enrolmentperioddate").val() === "";
63 enrollment_period: true,
66 enrolmentperioddate: {
67 required: function(element){
68 return $("#enrolmentperiod").val() === "";
70 enrollment_period: true
72 dateofbirthrequired: {
90 required: MSG_ONE_ENROLLMENTPERIOD
92 enrolmentperioddate: {
93 required: MSG_ONE_ENROLLMENTPERIOD