2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 ZMG LLC <sam@zhservices.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Vinish K <vinish@zhservices.com>
26 // +------------------------------------------------------------------------------+
28 <script type
="text/javascript">
29 function checkLength(eleName
,eleVal
,len
)
31 eleName
=eleName
.replace('form_','');
34 m +
= '<?php echo xl("Invalid length for")." "; ?>'+eleName
.toUpperCase()+
'.<?php echo " ".xl("The length should not exceed the following number of characters")." : "; ?>'+len+
"\n";
38 function checkSpecialCharacter(eleName
,eleVal
)
40 var regE
= /[^a
-zA
-Z
'\s,.\-]/;
42 eleName=eleName.replace('form_
','');
43 if(regE.test(eleVal)==true)
44 m += '<?php
echo xl("Invalid character in")." "?
>'+eleName.toUpperCase()+"\n";
48 function checkPhone(eleName,eleVal)
52 eleVal_temp
=eleVal
.replace(/[^
0-9]/ig
,'');
53 eleVal
=eleVal
.replace(/[-)(\s
]/ig
,'');
54 eleName
=eleName
.replace('form_','');
55 eleName
=eleName
.replace('_',' ');
56 if(regE
.test(eleVal
)==true)
57 m +
= '<?php echo xl("Invalid non-numeric character in")." "?>'+eleName
.toUpperCase()+
"\n";
58 else if(eleVal_temp
.length
>10)
59 m +
= eleName
.toUpperCase()+
'<?php echo " ".xl("should contain only 10 digits") ?>'+
"\n";
60 else if(eleVal_temp
.length
<10)
61 m +
= eleName
.toUpperCase()+
'<?php echo " ".xl("should contain 10 digits") ?>'+
"\n";
65 function checkTaxNpiDea(eleName
,eleVal
)
69 eleName
=eleName
.replace('_',' ');
70 if(regE
.test(eleVal
)==true)
71 m +
= '<?php echo xl("Invalid character in")." " ?>'+eleName
.toUpperCase()+
"\n";
75 function checkUsername(eleName
,eleVal
)
77 var regE
= /[^a
-zA
-Z0
-9_\
-']/;
79 eleName=eleName.replace('form_
','');
80 if(regE.test(eleVal)==true)
81 m += '<?php
echo xl("Invalid character in")." " ?
>'+eleName.toUpperCase()+"\n";
85 function checkAlphaNumeric(eleName,eleVal)
87 var regE = /[^a-zA-Z0-9\s]/;
89 eleName=eleName.replace('form_
','');
90 eleName=eleName.replace('_
',' ');
91 if(regE.test(eleVal)==true)
92 m += '<?php
echo xl("Invalid character in")." " ?
>'+eleName.toUpperCase()+"\n";