=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-02-01 09:10:08 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-02-09 03:25:25 +0000 @@ -142,6 +142,7 @@ function validateAddPatient() { + $("#editPatientDiv :input").attr("disabled", true); $.ajax({ type: "POST", url: 'validatePatient.action', @@ -160,17 +161,21 @@ removeDisabledIdentifier( ); addPatient( ); } - else if ( type == 'error' ) - { - showErrorMessage( i18n_adding_patient_failed + ':' + '\n' + message ); - } - else if ( type == 'input' ) - { - showWarningMessage( message ); - } - else if( type == 'duplicate' ) - { - showListPatientDuplicate(data, false); + else + { + $("#editPatientDiv :input").attr("disabled", true); + if ( type == 'error' ) + { + showErrorMessage( i18n_adding_patient_failed + ':' + '\n' + message ); + } + else if ( type == 'input' ) + { + showWarningMessage( message ); + } + else if( type == 'duplicate' ) + { + showListPatientDuplicate(data, false); + } } } @@ -181,7 +186,8 @@ function validateUpdatePatient() { - $.post( 'validatePatient.action?' + getIdParams( ), + $("#editPatientDiv :input").attr("disabled", true); + $.post( 'validatePatient.action?' + getIdParams( ), { id: jQuery( '#patientForm [id=id]' ).val(), fullName: jQuery( '#patientForm [id=fullName]' ).val(), @@ -200,18 +206,22 @@ removeDisabledIdentifier(); updatePatient(); } - else if ( type == 'error' ) - { - showErrorMessage( i18n_saving_patient_failed + ':' + '\n' + message ); - } - else if ( type == 'input' ) - { - showWarningMessage( message ); - } - else if( type == 'duplicate' ) - { - showListPatientDuplicate(messageElement, true); - } + else + { + $("#editPatientDiv :input").attr("disabled", true); + if ( type == 'error' ) + { + showErrorMessage( i18n_saving_patient_failed + ':' + '\n' + message ); + } + else if ( type == 'input' ) + { + showWarningMessage( message ); + } + else if( type == 'duplicate' ) + { + showListPatientDuplicate(messageElement, true); + } + } } // get and build a param String of all the identifierType id and its value // excluding inherited identifiers