@@ -2,13 +2,13 @@ function onChange(control, oldValue, newValue, isLoading) {
2
2
if ( isLoading || newValue == '' ) {
3
3
return ;
4
4
}
5
-
5
+
6
6
var cost = g_form . getValue ( 'variable_name' ) ; //update variable name used for currency
7
7
cost = cost . trim ( ) ;
8
8
// first character should be dollar sign
9
9
var firstChar = cost . substring ( 0 , 1 ) ;
10
10
if ( firstChar != '$' ) {
11
- validationAlert ( oldValue ) ;
11
+ validationAlert ( oldValue ) ;
12
12
}
13
13
14
14
// characters after the $ sign should be numerics
@@ -26,15 +26,15 @@ function onChange(control, oldValue, newValue, isLoading) {
26
26
// there must be 2 digits only after the decimal
27
27
var decNum = num . substring ( num . indexOf ( '.' ) + 1 , num . length ) ;
28
28
if ( decNum . length != 2 ) {
29
- validationAlert ( oldValue ) ;
29
+ validationAlert ( oldValue ) ;
30
30
}
31
31
}
32
32
33
33
function validationAlert ( oldValue ) {
34
- g_form . setValue ( "variable_name" , oldValue ) ;
35
- var gm = new GlideModal ( "glide_warn" ) ;
36
- gm . setTitle ( "Currency formatting problem" ) ;
37
- gm . setPreference ( "title" , "Please enter cost in $0.00 format" ) ;
38
- gm . render ( ) ;
39
- return ;
34
+ g_form . setValue ( "variable_name" , oldValue ) ;
35
+ var gm = new GlideModal ( "glide_warn" ) ;
36
+ gm . setTitle ( "Currency formatting problem" ) ;
37
+ gm . setPreference ( "title" , "Please enter cost in $0.00 format" ) ;
38
+ gm . render ( ) ;
39
+ return ;
40
40
}
0 commit comments