← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3215: WIP: extracting js/validation from template files in datadictionary

 

------------------------------------------------------------
revno: 3215
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-03-30 13:04:12 +0200
message:
  WIP: extracting js/validation from template files in datadictionary
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementForm.js
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm


--
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-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm	2011-03-18 14:14:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm	2011-03-30 11:04:12 +0000
@@ -1,13 +1,4 @@
-<script type="text/javascript">
-	jQuery(document).ready(	function(){
-		validation( 'addDataDictionaryForm', function( form ){ form.submit()}, function(){
-			listValidator( 'memberValidator', 'selectedDataElements' );
-			listValidator( 'memberValidatorIn', 'selectedIndicators' );
-		} );	
-		
-		checkValueIsExist( "name", "validateDataDictionary.action");
-	});
-</script>
+<script type="text/javascript" src="javascript/addDataDictionaryForm.js"></script>
 
 <h3>$i18n.getString( "create_new_data_dictionary" )</h3>
 
@@ -19,15 +10,15 @@
 	</tr>
 	<tr>
 		<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="name" name="name" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2}}"/></td>
+		<td><input type="text" id="name" name="name" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description" style="width:20em; height:8em" maxlength="255"></textarea></td>
+		<td><textarea id="description" name="description" style="width:20em; height:8em"></textarea></td>
 	</tr>
 	<tr>
 		<td><label for="region">$i18n.getString( "region" )</label></td>
-		<td><input type="text" id="region" name="region" style="width:20em" maxlength="255"/></td>
+		<td><input type="text" id="region" name="region" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td colspan="2" height="15px"></td>
@@ -39,7 +30,7 @@
 		<th>$i18n.getString( "available_data_elements" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected_data_elements" )
-		<select id="memberValidator" class="{validate:{required:true}}" style="display:none"/>
+			<select id="memberValidator" style="display:none"/>
 		</th>
 	</tr>
 	<tr>		
@@ -74,7 +65,7 @@
 		<th>$i18n.getString( "available_indicators" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected_indicators" )
-		<select id="memberValidatorIn" class="{validate:{required:true}}" style="display:none"/>
+		<select id="memberValidatorIn" style="display:none"/>
 		</th>
 	</tr>
 	<tr>		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2011-03-18 14:14:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2011-03-30 11:04:12 +0000
@@ -1,21 +1,5 @@
+<script type="text/javascript" src="javascript/addDataElementForm.js"></script>
 <script type="text/javascript">
-	jQuery(document).ready(	function() {
-		validation( 'addDataElementForm', function( form ){
-			form.submit();
-		},function(){
-			getDataElementIdsForValidate();
-			getFactors();
-			setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
-			setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
-		});
-		
-		checkValueIsExist( "name", "validateDataElement.action");
-		checkValueIsExist( "shortName", "validateDataElement.action");
-		checkValueIsExist( "alternativeName", "validateDataElement.action");
-
-		toggleCDEForm();
-	});
-
 	var previousName = '';
 </script>
 
@@ -30,23 +14,23 @@
 	</tr>
 	<tr>
 		<td style="width:200px"><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="name" name="name" style="width:20em" maxlength="150" class="{validate:{required:true,minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="name" name="name" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="shortName">$i18n.getString( "short_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="shortName" name="shortName" style="width:20em" maxlength="20" class="{validate:{required:true,minlength:2,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="shortName" name="shortName" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="alternativeName">$i18n.getString( "alternative_name" )</label></td>
-		<td><input type="text" id="alternativeName" name="alternativeName" style="width:20em" maxlength="150" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="alternativeName" name="alternativeName" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="code">$i18n.getString( "code" )</label></td>
-		<td><input type="text" id="code" name="code" style="width:20em" maxlength="40" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="code" name="code" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description" style="width:20em; height:8em" maxlength="150" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"></textarea></td>
+		<td><textarea id="description" name="description" style="width:20em; height:8em"></textarea></td>
 	</tr>
 	<tr>
 		<td><label for="domainType">$i18n.getString( "domain_type" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
@@ -100,7 +84,7 @@
 	</tr>
     <tr>
         <td><label for="url">$i18n.getString( "url" )</label></td>
-        <td><input type="text" id="url" name="url" style="width:20em" maxlength="255" class="{validate:{url:true}}"/></td>
+        <td><input type="text" id="url" name="url" style="width:20em"/></td>
     </tr>
 	<tr>	
 		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js	2011-03-30 11:04:12 +0000
@@ -0,0 +1,32 @@
+jQuery(document).ready(	function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		name: {
+			required: true,
+			rangelength: [2, 160]
+		},
+		description: {
+			rangelength: [0, 255]
+		},
+		region: {
+			rangelength: [0, 255]
+		},
+		memberValidator: {
+			required: true			
+		},
+		memberValidatorIn: {
+			required: true
+		}
+	};
+
+	validation2( 'addDataDictionaryForm', function( form ){ form.submit()}, {
+		'beforeValidateHandler': function() {
+			listValidator( 'memberValidator', 'selectedDataElements' );
+			listValidator( 'memberValidatorIn', 'selectedIndicators' );
+		},
+		'rules': rules
+	});
+	
+	checkValueIsExist( "name", "validateDataDictionary.action");
+});

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataElementForm.js	2011-03-30 11:04:12 +0000
@@ -0,0 +1,60 @@
+jQuery(document).ready(	function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		name: {
+			required:true,
+			rangelength: [3, 150],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		shortName: {
+			required:true,
+			rangelength: [2, 20],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		alternativeName: {
+			rangelength: [3, 150],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		code: {
+			rangelength: [3, 40],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		description: {
+			rangelength: [3, 250],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true			
+		},
+		url: {
+			 url: true,
+			 rangelength: [0, 255]
+		}
+	};
+
+	validation2( 'addDataElementForm', function( form ){ form.submit(); }, {
+		'beforeValidateHandler': function() {
+			getDataElementIdsForValidate();
+			getFactors();
+			setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
+			setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
+		},
+		'rules': rules
+	});
+
+	jQuery("#name").attr("maxlength", "150");
+	jQuery("#shortName").attr("maxlength", "20");
+	jQuery("#alternativeName").attr("maxlength", "150");
+	jQuery("#code").attr("maxlength", "40");
+	jQuery("#description").attr("maxlength", "250");
+	jQuery("#url").attr("maxlength", "255");
+	
+	checkValueIsExist( "name", "validateDataElement.action");
+	checkValueIsExist( "shortName", "validateDataElement.action");
+	checkValueIsExist( "alternativeName", "validateDataElement.action");
+
+	toggleCDEForm();
+});

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js	2011-03-30 11:04:12 +0000
@@ -0,0 +1,34 @@
+jQuery(document).ready(	function(){
+	var r = getValidationRules();
+	
+	var rules = {
+		name: {
+			required: true,
+			rangelength: [2, 160]
+		},
+		description: {
+			rangelength: [0, 255]
+		},
+		region: {
+			rangelength: [0, 255]
+		},
+		memberValidator: {
+			required: true			
+		},
+		memberValidatorIn: {
+			required: true
+		}
+	};
+
+	validation2( 'updateDataDictionaryForm', function( form ){ form.submit()}, {
+		'beforeValidateHandler': function(){
+			listValidator( 'memberValidator', 'selectedDataElements' );
+			listValidator( 'memberValidatorIn', 'selectedIndicators' );
+		},
+		'rules': rules
+	});
+
+	jQuery("#name").attr("maxlength", "160");
+	jQuery("#description").attr("maxlength", "255");
+	jQuery("#region").attr("maxlength", "255");
+});

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataElementForm.js	2011-03-30 11:04:12 +0000
@@ -0,0 +1,54 @@
+jQuery(document).ready(	function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		name: {
+			required:true,
+			rangelength: [3, 150],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		shortName: {
+			required:true,
+			rangelength: [2, 20],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		alternativeName: {
+			rangelength: [3, 150],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		code: {
+			rangelength: [3, 40],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true
+		},
+		description: {
+			rangelength: [3, 250],
+			alphanumericwithbasicpuncspaces:true,
+			notOnlyDigits:true			
+		},
+		url: {
+			 url: true,
+			 rangelength: [0, 255]
+		}
+	};
+
+	validation2( 'updateDataElementForm', function( form ) { form.submit(); }, {
+		'beforeValidateHandler': function() {
+			getDataElementIdsForValidate();
+			getFactors();	
+			setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
+			setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
+		},
+		'rules': rules 
+	});
+
+	jQuery("#name").attr("maxlength", "150");
+	jQuery("#shortName").attr("maxlength", "20");
+	jQuery("#alternativeName").attr("maxlength", "150");
+	jQuery("#code").attr("maxlength", "40");
+	jQuery("#description").attr("maxlength", "250");
+	jQuery("#url").attr("maxlength", "255");
+});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm	2011-03-18 14:14:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm	2011-03-30 11:04:12 +0000
@@ -1,10 +1,6 @@
+<script type="text/javascript" src="javascript/updateDataDictionaryForm.js"></script>
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		validation( 'updateDataDictionaryForm', function( form ) { form.submit()}, function() {
-			listValidator( 'memberValidator', 'selectedDataElements' );
-			listValidator( 'memberValidatorIn', 'selectedIndicators' );
-		} );
-
 		checkValueIsExist( "name", "validateDataDictionary.action", {id: $dataDictionary.id});
 	});
 </script>
@@ -23,15 +19,15 @@
 	</tr>
 	<tr>
 		<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataDictionary.name )" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2}}"/></td>
+		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataDictionary.name )" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description" style="width:20em; height:8em" maxlength="255"/>$!encoder.htmlEncode( $dataDictionary.description )</textarea></td>
+		<td><textarea id="description" name="description" style="width:20em; height:8em"/>$!encoder.htmlEncode( $dataDictionary.description )</textarea></td>
 	</tr>
 	<tr>
 		<td><label for="region">$i18n.getString( "region" )</label></td>
-		<td><input type="text" id="region" name="region" value="$!encoder.htmlEncode( $dataDictionary.region )" style="width:20em" maxlength="255"/></td>
+		<td><input type="text" id="region" name="region" value="$!encoder.htmlEncode( $dataDictionary.region )" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td colspan="2" height="15px"></td>
@@ -43,7 +39,7 @@
 		<th>$i18n.getString( "available_data_elements" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected_data_elements" )
-		<select id="memberValidator" class="{validate:{required:true}}" style="display:none"/></th>
+		<select id="memberValidator" style="display:none"/></th>
 	</tr>
 	<tr>		
 		<td><input type="text" id="availableDataElementsFilter" onkeyup="filterList( this.value, 'availableDataElements' )" style="width:100%"/></td>
@@ -80,7 +76,7 @@
 		<th>$i18n.getString( "available_indicators" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected_indicators" )
-		<select id="memberValidatorIn" class="{validate:{required:true}}" style="display:none"/></th>
+		<select id="memberValidatorIn" style="display:none"/></th>
 	</tr>
 	<tr>		
 		<td><input type="text" id="availableIndicatorsFilter" onkeyup="filterList( this.value, 'availableIndicators' )" style="width:100%"/></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	2011-03-22 05:49:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	2011-03-30 11:04:12 +0000
@@ -1,14 +1,6 @@
+<script type="text/javascript" src="javascript/updateDataElementForm.js"></script>
 <script type="text/javascript">
 	jQuery(document).ready(	function() {
-		validation( 'updateDataElementForm', function( form ){			
-			form.submit();
-		},function(){
-			getDataElementIdsForValidate();
-			getFactors();	
-			setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
-			setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
-		});				
-
 		checkValueIsExist( "name", "validateDataElement.action", {id:getFieldValue('id')});
 		checkValueIsExist( "shortName", "validateDataElement.action", {id:getFieldValue('id')});
 		checkValueIsExist( "alternativeName", "validateDataElement.action", {id:getFieldValue('id')});
@@ -35,23 +27,23 @@
 	</tr>
 	<tr>
 		<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataElement.name )" onchange="nameChanged()" style="width:20em" maxlength="150" class="{validate:{required:true,minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataElement.name )" onchange="nameChanged()" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="shortName">$i18n.getString( "short_name" )</label></td>
-		<td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $dataElement.shortName )" style="width:20em" maxlength="20" class="{validate:{required:true,minlength:2,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $dataElement.shortName )" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="alternativeName">$i18n.getString( "alternative_name" )</label></td>
-		<td><input type="text" id="alternativeName" name="alternativeName" value="$!encoder.htmlEncode( $dataElement.alternativeName )" style="width:20em" maxlength="150" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="alternativeName" name="alternativeName" value="$!encoder.htmlEncode( $dataElement.alternativeName )" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="code">$i18n.getString( "code" )</label></td>
-		<td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $dataElement.code )" style="width:20em" maxlength="40" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}"/></td>
+		<td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $dataElement.code )" style="width:20em"/></td>
 	</tr>
 	<tr>
 		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description" style="width:20em; height:8em" maxlength="250" class="{validate:{minlength:3,alphanumericwithbasicpuncspaces:true,notOnlyDigits:true}}">$!encoder.htmlEncode( $dataElement.description )</textarea></td>
+		<td><textarea id="description" name="description" style="width:20em; height:8em">$!encoder.htmlEncode( $dataElement.description )</textarea></td>
 	</tr>
 	<tr>
 		<td><label for="active">$i18n.getString( "active" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
@@ -127,7 +119,7 @@
 	</tr>
     <tr>
         <td><label for="url">$i18n.getString( "url" )</label></td>
-        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $dataElement.url )" style="width:20em" maxlength="255" class="{validate:{url:true}}"/></td>
+        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $dataElement.url )" style="width:20em"/></td>
     </tr>
 	<tr #if( $calculatedDataElement ) style="display:none" #end >	
 		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
@@ -265,7 +257,3 @@
 <p><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='dataElement.action'" style="width:10em"/></p>
 
 </form>
-
-<script type="text/javascript">
-
-</script>