|
Lines 37-43
Link Here
|
| 37 |
|
37 |
|
| 38 |
var MSG_INCORRECT_PHONE = _("Please enter a valid phone number."); |
38 |
var MSG_INCORRECT_PHONE = _("Please enter a valid phone number."); |
| 39 |
$.validator.addMethod('phone', function(value) { |
39 |
$.validator.addMethod('phone', function(value) { |
| 40 |
value = value.trim(); |
|
|
| 41 |
if (!value.trim()) { |
40 |
if (!value.trim()) { |
| 42 |
return 1; |
41 |
return 1; |
| 43 |
} |
42 |
} |
|
Lines 82-90
Link Here
|
| 82 |
$("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); |
81 |
$("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); |
| 83 |
if (form.beenSubmitted) |
82 |
if (form.beenSubmitted) |
| 84 |
return false; |
83 |
return false; |
| 85 |
else |
84 |
else { |
| 86 |
form.beenSubmitted = true; |
85 |
form.beenSubmitted = true; |
| 87 |
form.submit(); |
86 |
[% IF ValidateEmailAddress %] |
|
|
87 |
$("#email, #emailpro, #B_email").each(function(){ |
| 88 |
$(this).val($.trim($(this).val())); |
| 89 |
}); |
| 90 |
[% END %] |
| 91 |
[% IF ValidatePhoneNumber %] |
| 92 |
$("#phone, #phonepro, #B_phone, #SMSnumber").each(function(){ |
| 93 |
$(this).val($.trim($(this).val())); |
| 94 |
}); |
| 95 |
[% END %] |
| 96 |
form.submit(); |
| 97 |
} |
| 88 |
} |
98 |
} |
| 89 |
}); |
99 |
}); |
| 90 |
|
100 |
|
|
Lines 95-100
Link Here
|
| 95 |
$("#email").on("input", function(){ |
105 |
$("#email").on("input", function(){ |
| 96 |
disableCheckboxesWithInvalidPreferences($(this), "email"); |
106 |
disableCheckboxesWithInvalidPreferences($(this), "email"); |
| 97 |
}); |
107 |
}); |
|
|
108 |
$("#email, #emailpro, #B_email").on("change, click", function(){ |
| 109 |
$(this).val($.trim($(this).val())); |
| 110 |
disableCheckboxesWithInvalidPreferences($(this), "email"); |
| 111 |
}); |
| 98 |
[% END %] |
112 |
[% END %] |
| 99 |
|
113 |
|
| 100 |
[% IF ValidatePhoneNumber %] |
114 |
[% IF ValidatePhoneNumber %] |
|
Lines 105-115
Link Here
|
| 105 |
disableCheckboxesWithInvalidPreferences($("#phone"), "phone"); |
119 |
disableCheckboxesWithInvalidPreferences($("#phone"), "phone"); |
| 106 |
[% END %] |
120 |
[% END %] |
| 107 |
$("#SMSnumber").on("input", function(){ |
121 |
$("#SMSnumber").on("input", function(){ |
| 108 |
disableCheckboxesWithInvalidPreferences($(this), "sms"); |
122 |
disableCheckboxesWithInvalidPreferences($(this), "sms"); |
|
|
123 |
}); |
| 124 |
$("#SMSnumber").on("change, click", function(){ |
| 125 |
$(this).val($.trim($(this).val())); |
| 126 |
disableCheckboxesWithInvalidPreferences($(this), "sms"); |
| 109 |
}); |
127 |
}); |
| 110 |
$("#phone").on("input", function(){ |
128 |
$("#phone").on("input", function(){ |
| 111 |
disableCheckboxesWithInvalidPreferences($(this), "phone"); |
129 |
disableCheckboxesWithInvalidPreferences($(this), "phone"); |
| 112 |
}); |
130 |
}); |
|
|
131 |
$("#phone, #phonepro, #B_phone").on("change, click", function(){ |
| 132 |
$(this).val($.trim($(this).val())); |
| 133 |
disableCheckboxesWithInvalidPreferences($(this), "phone"); |
| 134 |
}); |
| 113 |
[% END %] |
135 |
[% END %] |
| 114 |
|
136 |
|
| 115 |
var mrform = $("#manual_restriction_form"); |
137 |
var mrform = $("#manual_restriction_form"); |