← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5518: Click on date-fiels to select date value.

 

------------------------------------------------------------
revno: 5518
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-21 16:38:14 +0700
message:
  Click on date-fiels to select date value.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-12-21 03:46:55 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-12-21 09:38:14 +0000
@@ -222,13 +222,13 @@
 function enable( elementId )
 {
 	var hasDatePicker = jQuery("#" + elementId ).data("datepicker");
-	if( hasDatePicker == undefined){
+	if( hasDatePicker == undefined)
+	{
 		jQuery( "#" + elementId ).removeAttr( "disabled" );
 	}
 	else
 	{
 		jQuery('#' + elementId ).datepicker( "enable" );
-		jQuery( "#" + elementId ).attr("disabled", true );
 	} 
 }
 
@@ -245,7 +245,8 @@
 function disable( elementId )
 {
 	var hasDatePicker = jQuery("#" + elementId ).data("datepicker");
-	if( hasDatePicker == undefined){
+	if( hasDatePicker == undefined)
+	{
 		jQuery( "#" + elementId ).attr("disabled", true );
 	}
 	else
@@ -855,7 +856,7 @@
 		constrainInput: true,
         yearRange: '-100:+100',
 	});
-	jQuery( "#" + id ).attr("disabled", true );
+	jQuery( "#" + id ).attr("readonly", true );
 	s = jQuery("#" + id );		
 	if( s.val()=='' ) s.val( getCurrentDate() );		
 }
@@ -875,7 +876,7 @@
 		constrainInput: true,
         yearRange: '-100:+100'
 	});
-	jQuery( "#" + id ).attr("disabled", true );
+	jQuery( "#" + id ).attr("readonly", true );
 	
 	if( today == undefined ) today = false;
 	
@@ -900,7 +901,7 @@
 		constrainInput: true,
         yearRange: '-100:+100'
 	});		
-	jQuery( "#" + id ).attr("disabled", true );
+	jQuery( "#" + id ).attr("readonly", true );
 }
 
 /**
@@ -924,7 +925,7 @@
 		constrainInput: true,
         yearRange: '-100:+100'
 	});
-	jQuery( "#" + id ).attr("disabled", true );
+	jQuery( "#" + id ).attr("readonly", true );
 	
 	if ( today == undefined )
 	{