Skip to content

Commit

Permalink
added error message if trying to add new cause of death with no disea…
Browse files Browse the repository at this point in the history
…se name
  • Loading branch information
regulator95 committed Feb 17, 2016
1 parent 81c4dbf commit 882fd67
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/fhh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ function bind_family_member_submit_button_action () {
// Validation age determination

$("#addFamilyMemberSubmitButton").on("click", function(){

// Cause of Death or Age/Estimated-Age variables
var alive_flag = $("#is_person_alive").val();
var age_determination_flag = $('#age_determination').val();
Expand Down Expand Up @@ -1094,6 +1095,14 @@ function bind_family_member_submit_button_action () {
return false;
}


// check if cause of death is a new disease and if the new disease is blank throw error message //
if ($("#is_person_alive").val()=='dead' && $("#cause_of_death_select").val()=='other' && $("#new_disease_name").val()=='') {
alert ($.t("fhh_js.invalid_cause_of_death"));
return false;
}


// Check to ensure the user has not entered anything in the disease section that they have not saved.
var disease_name = $("#update_family_member_health_history_dialog").find("#disease_choice_select").val();
var disease_code = $("#update_family_member_health_history_dialog").find("#detailed_disease_choice_select").val();
Expand Down
1 change: 1 addition & 0 deletions locales/translation-en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"done" : "done"
},
"fhh_js": {
"invalid_cause_of_death" : "Please enter a valid cause of death",
"ashkenazi" : "Why Ask About Ashkenazi?",
"pi":"Enter Personal Information",
"select_age": "Select Estimated Age",
Expand Down
1 change: 1 addition & 0 deletions locales/translation-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"done" : "done"
},
"fhh_js": {
"invalid_cause_of_death" : "Please enter a valid cause of death",
"ashkenazi" : "Why Ask About Ashkenazi?",
"pi":"Enter Personal Information",
"select_age": "Select Estimated Age",
Expand Down
1 change: 1 addition & 0 deletions locales/translation-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"done" : "done"
},
"fhh_js": {
"invalid_cause_of_death" : "Por favor, introduzca una causa válida de muerte",
"ashkenazi": "¿Por qué preguntamos sobre el origen judio Ashkenazi?",
"pi":"Introduzca información personal",
"select_age": "Seleccione Edad estimada",
Expand Down
1 change: 1 addition & 0 deletions locales/translation-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},

"fhh_js": {
"invalid_cause_of_death" : "Si prega di inserire una causa valida della morte",
"ashkenazi": "Perché chiedere di Ashkenazi?",
"pi": "inserire informazioni personali",
"select_age": "Selezionare Età stimata",
Expand Down
1 change: 1 addition & 0 deletions locales/translation-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},

"fhh_js": {
"invalid_cause_of_death" : "Por favor, indique uma causa válida de morte",
"ashkenazi": "Por que perguntar sobre Ashkenazi?",
"pi": "Inserir informações pessoais",
"select_age": "Selecione idade estimada",
Expand Down

0 comments on commit 882fd67

Please sign in to comment.