← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15833: Data entry, better handling of data type validation failures

 

------------------------------------------------------------
revno: 15833
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-06-24 16:58:45 +0200
message:
  Data entry, better handling of data type validation failures
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-06-23 08:05:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-06-24 14:58:45 +0000
@@ -255,10 +255,15 @@
  */
 function alertField( fieldId, alertMessage )
 {
-    $( fieldId ).css( 'background-color', COLOR_YELLOW );
-    $( fieldId ).select();
-    $( fieldId ).focus();    
+    var $field = $( fieldId );
+    $field.css( 'background-color', COLOR_YELLOW );
+
     window.alert( alertMessage );
+    
+    var val = dhis2.de.currentExistingValue || '';
+    $field.val( val );
+    
+    $field.focus();
 
     return false;
 }