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 checkFacilityName(eleName,eleVal)
50 var regE = /[^a-zA-Z0-9 '().,#:\/\-@_%]/;
52 eleName
=eleName
.replace('form_','');
53 if(regE
.test(eleVal
)==true)
54 m +
= '<?php echo xl("Invalid character in")." "?>'+eleName
.toUpperCase()+
"\n";
58 function checkPhone(eleName
,eleVal
)
62 eleVal_temp=eleVal.replace(/[^0-9]/ig,'');
63 eleVal=eleVal.replace(/[-)(\s]/ig,'');
64 eleName=eleName.replace('form_
','');
65 eleName=eleName.replace('_
',' ');
66 if(regE.test(eleVal)==true)
67 m += '<?php
echo xl("Invalid non-numeric character in")." "?
>'+eleName.toUpperCase()+"\n";
68 else if(eleVal_temp.length>10)
69 m += eleName.toUpperCase()+'<?php
echo " ".xl("should contain only 10 digits") ?
>'+"\n";
70 else if(eleVal_temp.length<10)
71 m += eleName.toUpperCase()+'<?php
echo " ".xl("should contain 10 digits") ?
>'+"\n";
75 function checkTaxNpiDea(eleName,eleVal)
79 eleName=eleName.replace('_
',' ');
80 if(regE.test(eleVal)==true)
81 m += '<?php
echo xl("Invalid character in")." " ?
>'+eleName.toUpperCase()+"\n";
85 function checkFederalEin(eleName,eleVal)
87 var regE = /[^a-zA-Z0-9 '().,#:\/\-@_%]/;
89 eleName
=eleName
.replace('_',' ');
90 if(regE
.test(eleVal
)==true)
91 m +
= '<?php echo xl("Invalid character in")." " ?>'+eleName
.toUpperCase()+
"\n";
95 function checkStateLicenseNumber(eleName
,eleVal
)
97 var regE
= /[^a
-zA
-Z0
-9 '.,()#:\/\-@_%\r\n]/;
99 eleName=eleName.replace('_
',' ');
100 if(regE.test(eleVal)==true)
101 m += '<?php
echo xl("Invalid character in")." " ?
>'+eleName.toUpperCase()+"\n";
105 function checkUsername(eleName,eleVal)
107 var regE = /[^a-zA-Z0-9 '().,#:\/\-@_%]/;
109 eleName
=eleName
.replace('form_','');
110 if(regE
.test(eleVal
)==true)
111 m +
= '<?php echo xl("Invalid character in")." " ?>'+eleName
.toUpperCase()+
"\n";
115 function checkAlphaNumeric(eleName
,eleVal
)
117 var regE
= /[^a
-zA
-Z0
-9\s
]/;
119 eleName
=eleName
.replace('form_','');
120 eleName
=eleName
.replace('_',' ');
121 if(regE
.test(eleVal
)==true)
122 m +
= '<?php echo xl("Invalid character in")." " ?>'+eleName
.toUpperCase()+
"\n";
126 function checkAlphaNumericExtended(eleName
,eleVal
)
128 var regE
= /[^a
-zA
-Z0
-9 '().,#:\/\-@_%]/;
130 eleName=eleName.replace('form_
','');
131 eleName=eleName.replace('_
',' ');
132 if(regE.test(eleVal)==true)
133 m += '<?php
echo xl("Invalid character in")." " ?
>'+eleName.toUpperCase()+"\n";