Lines 84-89
var myDate2=document.form.dateexpiry.value.split ('/');
Link Here
|
84 |
|
84 |
|
85 |
// function to test all fields in forms and nav in different forms(1 ,2 or 3) |
85 |
// function to test all fields in forms and nav in different forms(1 ,2 or 3) |
86 |
function check_form_borrowers(nav){ |
86 |
function check_form_borrowers(nav){ |
|
|
87 |
//alert('email'+document.form.email.value+'\nemailpro:'+document.form.emailpro.value+'\nB_email:'+document.form.B_email.value); |
88 |
|
87 |
var statut=0; |
89 |
var statut=0; |
88 |
if (document.form.check_member.value == 1 ) |
90 |
if (document.form.check_member.value == 1 ) |
89 |
{ |
91 |
{ |
Lines 139-145
function check_form_borrowers(nav){
Link Here
|
139 |
document.form.nodouble.value=1; |
141 |
document.form.nodouble.value=1; |
140 |
} |
142 |
} |
141 |
} |
143 |
} |
142 |
|
144 |
|
|
|
145 |
//validate email addresses |
146 |
function isValidEmailAddress(emailAddress) { |
147 |
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); |
148 |
return pattern.test(emailAddress); |
149 |
} |
150 |
if (statut!=1) { |
151 |
if (document.form.email.value != 0 && (!isValidEmailAddress(document.form.email.value))) |
152 |
{ |
153 |
message=''; |
154 |
statut=1; |
155 |
message_champ+=document.form.email.value+' is not a valid email address\n'; |
156 |
} |
157 |
if (document.form.emailpro.value != 0 && (!isValidEmailAddress(document.form.emailpro.value))) |
158 |
{ |
159 |
message=''; |
160 |
statut=1; |
161 |
message_champ+=document.form.emailpro.value+' is not a valid email address\n'; |
162 |
} |
163 |
if (document.form.B_email.value != 0 && (!isValidEmailAddress(document.form.B_email.value))) |
164 |
{ |
165 |
message=''; |
166 |
statut=1; |
167 |
message_champ+=document.form.B_email.value+' is not a valid email address\n'; |
168 |
} |
169 |
} |
170 |
|
143 |
if (statut==1){ |
171 |
if (statut==1){ |
144 |
//alert if at least 1 error |
172 |
//alert if at least 1 error |
145 |
alert(message+"\n"+message_champ); |
173 |
alert(message+"\n"+message_champ); |
146 |
- |
|
|