=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2014-07-12 12:11:56 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2014-07-18 04:16:17 +0000 @@ -1035,34 +1035,29 @@ } else { var type = $('#enrollmentDiv [name=programId] option:selected').attr( 'programType') - if (type == '2') { - hideById('enrollmentDateTR'); + + showById('enrollmentDateTR'); + enable('enrollmentDateField'); + var dateOfEnrollmentDescription = $( + '#enrollmentDiv [name=programId] option:selected').attr( + 'dateOfEnrollmentDescription'); + var dateOfIncidentDescription = $( + '#enrollmentDiv [name=programId] option:selected').attr( + 'dateOfIncidentDescription'); + setInnerHTML('enrollmentDateDescription', + dateOfEnrollmentDescription); + setInnerHTML('dateOfIncidentDescription', dateOfIncidentDescription); + var displayIncidentDate = $( + '#enrollmentDiv [name=programId] option:selected').attr( + 'displayIncidentDate'); + if (displayIncidentDate == 'true') { + showById('dateOfIncidentTR'); + enable('dateOfIncidentField'); + } else { hideById('dateOfIncidentTR'); - disable('enrollmentDateField'); disable('dateOfIncidentField'); - } else { - showById('enrollmentDateTR'); - enable('enrollmentDateField'); - var dateOfEnrollmentDescription = $( - '#enrollmentDiv [name=programId] option:selected').attr( - 'dateOfEnrollmentDescription'); - var dateOfIncidentDescription = $( - '#enrollmentDiv [name=programId] option:selected').attr( - 'dateOfIncidentDescription'); - setInnerHTML('enrollmentDateDescription', - dateOfEnrollmentDescription); - setInnerHTML('dateOfIncidentDescription', dateOfIncidentDescription); - var displayIncidentDate = $( - '#enrollmentDiv [name=programId] option:selected').attr( - 'displayIncidentDate'); - if (displayIncidentDate == 'true') { - showById('dateOfIncidentTR'); - enable('dateOfIncidentField'); - } else { - hideById('dateOfIncidentTR'); - disable('dateOfIncidentField'); - } } + var program = $('#programEnrollmentSelectDiv [id=programId] option:selected'); $('#identifierAndAttributeDiv') .load("getAttribute.action", {