------------------------------------------------------------ revno: 4810 committer: Tran Chau <tran.hispviet...@gmail.com> branch nick: dhis2 timestamp: Tue 2011-10-04 09:34:03 +0700 message: Description of enrollment date field must be hidden when ticking single-event. modified: dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2011-10-04 02:19:13 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2011-10-04 02:34:03 +0000 @@ -1,4 +1,4 @@ - <script> +<script> jQuery(document).ready( function(){ validation( 'addProgramForm', function( form ){ form.submit(); @@ -28,14 +28,17 @@ <tr> <td><label>$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td> - <td> - <input type="text" id="description" name="description" style="width:23em" class="{validate:{required:true,minlength:4}}"> - <label>$i18n.getString( "single_event" )</label><input type="checkbox" id="singleEvent" name="singleEvent" value='true'> - </td> + <td><input type="text" id="description" name="description" style="width:30em" class="{validate:{required:true,minlength:4}}"></td> <td></td> </tr> <tr> + <td><label>$i18n.getString( "single_event" )</label></td> + <td><input type="checkbox" id="singleEvent" name="singleEvent" value='true' onchange="singleEventOnChange();"></td> + <td></td> + </tr> + + <tr> <td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td> <td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" style="width:30em" class="{validate:{required:true,minlength:4}}"></td> <td></td> === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2011-09-28 07:11:18 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2011-10-04 02:34:03 +0000 @@ -66,3 +66,17 @@ } } +function singleEventOnChange() +{ + var checked = byId('singleEvent').checked; + + if(checked) + { + disable('dateOfEnrollmentDescription'); + } + else + { + enable('dateOfEnrollmentDescription'); + } +} + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2011-09-29 04:17:34 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2011-10-04 02:34:03 +0000 @@ -35,6 +35,13 @@ <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $program.description )" style="width:30em" class="{validate:{required:true,minlength:4}}"></td> <td></td> </tr> + + <tr> + <td><label>$i18n.getString( "single_event" )</td> + <td><input type="checkbox" id="singleEvent" name="singleEvent" #if( $program.singleEvent=='true' ) checked #end onchange="singleEventOnChange();"></td> + <td></td> + </tr> + <tr> <td><label>$i18n.getString( "version" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td> <td><input type="text" id="version" name="version" value="$program.version" style="width:30em" class="{validate:{required:true,number:true}}"></td> @@ -56,12 +63,6 @@ <td><input type="text" id="maxDaysAllowedInputData" name="maxDaysAllowedInputData" value="$!program.maxDaysAllowedInputData" style="width:30em" class="{validate:{required:true,number:true}}"></td> <td></td> </tr> - - <tr> - <td><label>$i18n.getString( "single_event" )</td> - <td><input type="checkbox" id="singleEvent" name="singleEvent" #if( $program.singleEvent=='true' ) checked #end></td> - <td></td> - </tr> <tr> <td colspan="2" style="height:15px"></td>
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp