Lines 15-23
Link Here
|
15 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> |
15 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> |
16 |
|
16 |
|
17 |
<script type="text/javascript"> |
17 |
<script type="text/javascript"> |
18 |
var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field.")); |
18 |
var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them")); |
19 |
var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them")); |
19 |
</script> |
20 |
</script> |
20 |
|
|
|
21 |
|
21 |
|
22 |
|
22 |
<script type="text/javascript"> |
23 |
<script type="text/javascript"> |
23 |
jQuery.validator.addMethod( "password_match", function(value,element){ |
24 |
jQuery.validator.addMethod( "password_match", function(value,element){ |
Lines 34-63
jQuery.validator.addMethod( "password_match", function(value,element){
Link Here
|
34 |
}, MSG_PASSWORD_MISMATCH |
35 |
}, MSG_PASSWORD_MISMATCH |
35 |
); |
36 |
); |
36 |
|
37 |
|
37 |
jQuery.validator.addMethod( "letters_only", function(value,element){ |
|
|
38 |
var patt =/^[a-zA-Z ]+$/g; |
39 |
if (patt.test(element.value)){ |
40 |
return true; |
41 |
} else { |
42 |
return false; |
43 |
} |
44 |
}, MSG_DESCRIPTION_LETTERS_ONLY |
45 |
); |
46 |
|
47 |
|
48 |
jQuery.validator.addMethod( "cardnumber_check", function(value,element){ |
49 |
var patt =/[A-Za-z1-9 ]+$/g; |
50 |
if (patt.test(element.value)){ |
51 |
return true; |
52 |
} else { |
53 |
return false; |
54 |
} |
55 |
}, MSG_CARDNUMBER_LETTERS_NUMBERS_ONLY |
56 |
); |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
$(document).ready(function(){ |
38 |
$(document).ready(function(){ |
62 |
|
39 |
|
63 |
$("#Submit").click(function(){ |
40 |
$("#Submit").click(function(){ |
Lines 65-94
$(document).ready(function(){
Link Here
|
65 |
rules: { |
42 |
rules: { |
66 |
surname: { |
43 |
surname: { |
67 |
required: true, |
44 |
required: true, |
68 |
letters_only: true |
|
|
69 |
}, |
45 |
}, |
70 |
firstname: { |
46 |
firstname: { |
71 |
required: true, |
47 |
required: true, |
72 |
letters_only: true |
|
|
73 |
}, |
48 |
}, |
74 |
cardnumber: { |
49 |
cardnumber: { |
75 |
required: true, |
50 |
required: true, |
76 |
cardnumber_check: true |
|
|
77 |
}, |
51 |
}, |
78 |
password: { |
52 |
password: { |
79 |
password_match:true |
53 |
password_match:true |
80 |
} |
54 |
} |
81 |
}, |
55 |
}, |
82 |
messages: { |
56 |
messages: { |
83 |
surname: { |
|
|
84 |
required: MSG_DESCRIPTION_LETTERS_ONLY |
85 |
}, |
86 |
firstname: { |
87 |
required: MSG_DESCRIPTION_LETTERS_ONLY |
88 |
}, |
89 |
cardnumber: { |
90 |
required: MSG_CARDNUMBER_LETTERS_NUMBERS_ONLY |
91 |
}, |
92 |
password: { |
57 |
password: { |
93 |
required: MSG_PASSWORD_MISMATCH |
58 |
required: MSG_PASSWORD_MISMATCH |
94 |
}, |
59 |
}, |
Lines 163-174
$(document).ready(function(){
Link Here
|
163 |
<h3>Patron identity</h3> |
128 |
<h3>Patron identity</h3> |
164 |
<li> |
129 |
<li> |
165 |
<label for="surname" class="required">Surname: </label> |
130 |
<label for="surname" class="required">Surname: </label> |
166 |
<input type="text" pattern="[a-zA-Z- ]+" title="Please only enter letters in the surname field" id="surname" name="surname" value="[% surname %]" class="required" required="required" /> |
131 |
<input type="text" id="surname" name="surname" title="Please only enter letters in the surname field" value="[% surname |html %]" class="required" required="required" /> |
167 |
<span class="required">Required</span> |
132 |
<span class="required">Required</span> |
168 |
</li> |
133 |
</li> |
169 |
<li> |
134 |
<li> |
170 |
<label for="firstname" class="required">First name: </label> |
135 |
<label for="firstname" class="required">First name: </label> |
171 |
<input type="text" pattern="[a-zA-Z ]+" title="Please only enter letters in the firstname field" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> |
136 |
<input type="text" name="firstname" title="Please only enter letters in the first name field" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> |
172 |
<span class="required">Required</span> |
137 |
<span class="required">Required</span> |
173 |
</li> |
138 |
</li> |
174 |
</ol> |
139 |
</ol> |
Lines 177-185
$(document).ready(function(){
Link Here
|
177 |
<li> |
142 |
<li> |
178 |
<label for="cardnumber" class="required">Card number: </label> |
143 |
<label for="cardnumber" class="required">Card number: </label> |
179 |
[% IF patrons && patrons > 1 %] |
144 |
[% IF patrons && patrons > 1 %] |
180 |
<input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber %]" class="required" required="required"> |
145 |
<input type="text" id="cardnumber" title="Please enter a cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber | html %]" class="required" required="required"> |
181 |
[% ELSE %] |
146 |
[% ELSE %] |
182 |
<input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field"id="cardnumber" name="cardnumber" value="[% cardnumber %]" class="required" required="required"> |
147 |
<input type="text" id="cardnumber" title="Please enter a cardnumber" name="cardnumber" value="[% cardnumber | html %]" class="required" required="required"> |
183 |
[% END %] |
148 |
[% END %] |
184 |
<span class="required">Required</span> |
149 |
<span class="required">Required</span> |
185 |
</li> |
150 |
</li> |
Lines 221-227
$(document).ready(function(){
Link Here
|
221 |
<li> |
186 |
<li> |
222 |
<input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] /> |
187 |
<input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] /> |
223 |
<label for="userid" class="required">Username: </label> |
188 |
<label for="userid" class="required">Username: </label> |
224 |
<input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" /> |
189 |
<input type="text" name="userid" id ="userid" size="20" title="Please only enter a username of letters and numbers" value="[% userid |html %]" class="required" required="required" /> |
225 |
<span class="required">Required</span> |
190 |
<span class="required">Required</span> |
226 |
</li> |
191 |
</li> |
227 |
<li> |
192 |
<li> |