diff --git a/cara/apps/calculator/static/js/form.js b/cara/apps/calculator/static/js/form.js index 61e7e204..59cb888a 100644 --- a/cara/apps/calculator/static/js/form.js +++ b/cara/apps/calculator/static/js/form.js @@ -881,7 +881,7 @@ $(document).ready(function () { // Validate row button (Save button) $("body").on("click", ".validate_node_btn_frm_field", function() { - let index = $(this).attr('id').split('_').slice(-1)[0]; + var index = $(this).attr('id').split('_').slice(-1)[0]; let activity = validate_sr_parameter('#sr_activity_no_' + String(index)[0], "Required input."); let start = validate_sr_parameter('#sr_start_no_' + String(index)[0], "Required input."); let duration = validate_sr_parameter('#sr_duration_no_' + String(index)[0], "Required input."); @@ -896,6 +896,11 @@ $(document).ready(function () { index = index + 1; } } + $(".validate_node_btn_frm_field").not(".row_validated").not(this).each(function( index ) { + index = $(this).attr('id').split('_').slice(-1)[0]; + if ($('#sr_start_no_' + String(index)[0]).val() != "") validate_sr_parameter('#sr_start_no_' + String(index)[0], "Required input."); + if ($('#sr_duration_no_' + String(index)[0]).val() != "") validate_sr_parameter('#sr_duration_no_' + String(index)[0], "Required input."); + }); }); //Edit short range activity type