=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2011-09-19 07:44:36 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2011-09-20 14:48:24 +0000 @@ -339,19 +339,19 @@ }); jQuery.validator.addMethod("number", function(value, element, param) { - return isRealNumber(value); + return this.optional(element) || isRealNumber(value); }); jQuery.validator.addMethod("integer", function(value, element, param) { - return isInt(value); + return this.optional(element) || isInt(value); }); jQuery.validator.addMethod("positive_integer", function(value, element, param) { - return isPositiveInt(value); + return this.optional(element) || isPositiveInt(value); }); jQuery.validator.addMethod("negative_integer", function(value, element, param) { - return isNegativeInt(value); + return this.optional(element) || isNegativeInt(value); }); // Support method for date === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-09-19 07:44:36 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm 2011-09-20 14:48:24 +0000 @@ -347,26 +347,70 @@ #end -#macro( tblDynamicAttributes $attributes ) +#macro( tblDynamicAttributesJavascript ) +var attributes = jQuery("form").find(":input[name*='attribute_']"); +var jqAttributeValues= jQuery("#attributeValues"); +jqAttributeValues.children().remove(); + +jQuery.each(attributes, function(i, item) { + var jqItem = jQuery(item); + var json = {}; + + json.id = jqItem.attr("id").split("_")[1]; + + if( jqItem.is("input[type='text']") ) + { + json.value = jqItem.val(); + } + else if( jqItem.is("select") ) + { + json.value = jqItem.find(":selected").val(); + } + + json = JSON.stringify(json); + + jQuery("