← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2295: Fix bug: In Edit Validation Rule, user can enter wrong mathematical formula in expression left a...

 

------------------------------------------------------------
revno: 2295
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-10-01 16:19:22 +0700
message:
  Fix bug: In Edit Validation Rule,  user can enter wrong mathematical formula in expression left and right (both side).
modified:
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expression.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expression.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expression.js	2010-09-18 10:34:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expression.js	2010-10-01 09:19:22 +0000
@@ -87,7 +87,7 @@
 }
 
 function checkNotEmpty( field, message ){
-		
+
 	if( field.value.length == 0 ){
 		setInnerHTML( field.name + "Info", message );
 		$( '#'+ field.name ).css( "background-color", "#ffc5c5" );
@@ -114,6 +114,11 @@
 			{expression: expression},
 			function( json ){
 				byId( "textualExpression" ).innerHTML = json.message;
+				if( json.response == 'error')
+				{
+					$( '#expression' ).css( "background-color", "#ffc5c5" );
+					return;
+				}
 				var description = byId( "expDescription" ).value;
 				var expression = byId( "expression" ).value;
 				var textualDescription = byId( "textualExpression" ).innerHTML;