No regular expressions were active.
|
|
1 |
|
function d
oShowHideS
econdProfi
le( sShow,
eForm ) {
|
|
|
2 |
|
if( sS
how == 'ye
s' )
|
|
|
3 |
|
$(
'.form_se
cond_col',
eForm ).c
ss( 'displ
ay', '' );
|
|
|
4 |
|
else
|
|
|
5 |
|
$(
'.form_se
cond_col',
eForm ).c
ss( 'displ
ay', 'none
' );
|
|
|
6 |
|
}
|
|
|
7 |
|
|
|
|
8 |
|
function v
alidateEdi
tForm( eFo
rm ) {
|
|
|
9 |
|
if( !e
Form )
|
|
|
10 |
|
re
turn false
;
|
|
|
11 |
|
|
|
|
12 |
|
hideEd
itFormErro
rs( eForm
);
|
|
|
13 |
|
|
|
|
14 |
|
$(eFor
m).ajaxSub
mit(functi
on(sRespon
ce) {
|
|
|
15 |
|
//
alert( sRe
sponce );
|
|
|
16 |
|
tr
y {
|
|
|
17 |
|
var aErr
ors = eval
(sResponce
);
|
|
|
18 |
|
}
catch(e) {
|
|
|
19 |
|
return f
alse;
|
|
|
20 |
|
}
|
|
|
21 |
|
|
|
|
22 |
|
do
ShowEditEr
rors( aErr
ors, eForm
);
|
|
|
23 |
|
} );
|
|
|
24 |
|
|
|
|
25 |
|
return
false;
|
|
|
26 |
|
}
|
|
|
27 |
|
|
|
|
28 |
|
function h
ideEditFor
mErrors( e
Form ) {
|
|
|
29 |
|
$( 'im
g.form_war
n_icon', e
Form ).css
( 'display
', 'none'
);
|
|
|
30 |
|
$( '.i
nput_erron
eus', eFor
m ).remove
Class( 'in
put_errone
us' );
|
|
|
31 |
|
}
|
|
|
32 |
|
|
|
|
33 |
|
function d
oShowEditE
rrors( aEr
rors, eFor
m ) {
|
|
|
34 |
|
if( !a
Errors ||
!eForm )
|
|
|
35 |
|
re
turn false
;
|
|
|
36 |
|
|
|
|
37 |
|
var bH
aveErrors
= false;
|
|
|
38 |
|
|
|
|
39 |
|
for( v
ar iInd =
0; iInd <
aErrors.le
ngth; iInd
++ ) {
|
|
|
40 |
|
va
r aErrorsI
nd = aErro
rs[iInd];
|
|
|
41 |
|
fo
r( var sFi
eld in aEr
rorsInd )
{
|
|
|
42 |
|
var sErr
or = aErro
rsInd[ sFi
eld ];
|
|
|
43 |
|
bHaveErr
ors = true
;
|
|
|
44 |
|
|
|
|
45 |
|
doShowEr
ror( eForm
, sField,
iInd, sErr
or );
|
|
|
46 |
|
}
|
|
|
47 |
|
}
|
|
|
48 |
|
|
|
|
49 |
|
if( !b
HaveErrors
)
|
|
|
50 |
|
eF
orm.submit
();
|
|
|
51 |
|
}
|
|
|
52 |
|
|
|
|
53 |
|
function d
oShowError
( eForm, s
Field, iIn
d, sError
) {
|
|
|
54 |
|
var $F
ield = $(
"[name='"
+ sField +
"']", eFo
rm ); // s
ingle (sys
tem) field
|
|
|
55 |
|
if( !$
Field.leng
th ) // co
uple field
|
|
|
56 |
|
$F
ield = $(
"[name='"
+ sField +
'[' + iIn
d + ']' +
"']", eFor
m );
|
|
|
57 |
|
if( !$
Field.leng
th ) // co
uple multi
-select
|
|
|
58 |
|
$F
ield = $(
"[name='"
+ sField +
'[' + iIn
d + '][]'
+ "']", eF
orm );
|
|
|
59 |
|
if( !$
Field.leng
th ) // co
uple range
(two fiel
ds)
|
|
|
60 |
|
$F
ield = $(
"[name='"
+ sField +
'[' + iIn
d + '][0]'
+ "'],[na
me='" + sF
ield + '['
+ iInd +
'][1]' + "
']", eForm
);
|
|
|
61 |
|
|
|
|
62 |
|
//aler
t( sField
+ ' ' + $F
ield.lengt
h );
|
|
|
63 |
|
|
|
|
64 |
|
$Field
.addClass(
'input_er
roneus' );
|
|
|
65 |
|
|
|
|
66 |
|
$Icon
= $Field.s
iblings( '
img.form_w
arn_icon'
);
|
|
|
67 |
|
$Icon.
css( 'disp
lay', '' )
;
|
|
|
68 |
|
$Icon.
mouseover(
function(
){ showFlo
atDesc(sEr
ror) } );
|
|
|
69 |
|
}
|