dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07736
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2263: Minor fix.
------------------------------------------------------------
revno: 2263
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-09-28 16:06:13 +0700
message:
Minor fix.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.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-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm 2010-09-25 07:53:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm 2010-09-28 09:06:13 +0000
@@ -21,14 +21,34 @@
<script>
jQuery(document).ready( function(){
- validation( 'addPatientForm', validateAddPatient );
- datePickerValid( 'birthDate' );
+ //validation( 'addPatientForm', validateAddPatient );
+ datePickerValid( 'birthDate' );
+
+ jQuery("#addPatientForm").validate({
+ meta:"validate"
+ ,errorElement:"span"
+ ,submitHandler: function(form)
+ {
+ validateAddPatient();
+ }
+ ,beforeValidateHandler: function(form)
+ {
+ var birthDate = $('#birthDate').val();
+ var age = $('#age').val();
+ if(age !=''){
+ $( "#memberValidator").val(age);
+ }else{
+ $( "#memberValidator").val(birthDate);
+ }
+ }
+ });
+
});
</script>
<h3>$i18n.getString( "add_new_patient" )</h3>
-<form id="addPatientForm" action="addPatient.action" method="post">
+<form id="addPatientForm" name="addPatientForm" action="addPatient.action" method="post">
<input type="hidden" id="representativeId" name="representativeId"/>
<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
<table>
@@ -68,16 +88,20 @@
<tr>
<td><label for="birthDate">$i18n.getString( "date_of_birth" )<em title="$i18n.getString( "required" )" class="required">*</em> </label></td>
<td>
- <input type="text" id="birthDate" name="birthDate" style="width:10em" onchange="bdOnchange()" >
+ <input type="text" id="birthDate" name="birthDate" style="width:10em" onchange="bdOnchange()" >
<label for="age">$i18n.getString( "or" ) $i18n.getString( "age" ) </label>
<input type="text" id="age" name="age" style="width:4em" onchange="ageOnchange()" class="{validate:{number:true, alphanumeric: true}}">
<label for="estimated">$i18n.getString( "estimated" )</label>
- <input type="checkbox" id="birthDateEstimated" name="birthDateEstimated" value="true">
+ <input type="checkbox" id="birthDateEstimated" name="birthDateEstimated" value="true">
</td>
<td></td>
</tr>
+ <tr>
+ <td></td>
+ <td><input id="memberValidator" style="display:none" class="{validate:{required:true}}"/></td>
+ </tr>
<tr>
<td><label for="bloodGroup">$i18n.getString( "blood_group" )</label></td>
<td class="input-column">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-09-25 07:53:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-09-28 09:06:13 +0000
@@ -475,16 +475,18 @@
function ageOnchange()
{
- jQuery("#birthDate").val("").removeClass("error").rules("remove","required");
- jQuery("#age").rules("add",{required:true});
+ //jQuery("#birthDate").val("").removeClass("error").rules("remove","required");
+ //jQuery("#age").rules("add",{required:true});
+ jQuery("#birthDate").val("");
}
function bdOnchange()
{
- jQuery("#age").rules("remove","required");
- jQuery("#age").val("")
- jQuery("#birthDate").rules("add",{required:true});
+ //jQuery("#age").rules("remove","required");
+ //jQuery("#age").val("");
+ //jQuery("#birthDate").rules("add",{required:true});
+ jQuery("#age").val("");
}