diff --git a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php index af9ac6f1..87a0f41a 100644 --- a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php +++ b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php @@ -365,6 +365,39 @@ $('#execution-form-wrapper').show() $('#table-wrapper').hide() $('#execution-no_of_patients_on_duolin').attr('max',10); + + $('#execution-type_of_meeting').on('change',function(){ + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("Type of Meet",type_of_meet); + + if(type_of_meet==='Asthma camp'){ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); + $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); + + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + } + }) + + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("Type of Meet without change",type_of_meet); + + if(type_of_meet==='Asthma camp'){ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); + $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); + + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + + } }) jQuery(document).ready(function($) { @@ -440,7 +473,7 @@ recordDateField.setAttribute('min', today); var executionDateField = document.getElementById('execution-plan_date'); - // executionDateField.setAttribute('min', today); + executionDateField.setAttribute('min', today); $('.edit-btn').click(function() { var executionexeField = document.getElementById('execution-record_date'); diff --git a/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php b/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php index 3fa1a2e4..0c60dbff 100644 --- a/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php +++ b/resources/views/form/rapport-team3/1655458544-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac4.blade.php @@ -412,6 +412,34 @@ $('#table-wrapper').hide() $('#execution-attendence').attr({min:"1"}); $('#execution-no_of_patients_on_duolin').attr('max',10); + + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("type of meet",type_of_meet); + + if(type_of_meet==='Asthma Camp'){ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); + $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + + } + + $('#execution-type_of_meeting').on('change',function(){ + let type_of_meet=$('##execution-type_of_meeting').val(); + if(type_of_meet==='Asthma Camp'){ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); + } + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + } + }) + }) @@ -530,7 +558,7 @@ // recordDateField.setAttribute('max', today); var executionDateField = document.getElementById('execution-plan_date'); - // executionDateField.setAttribute('min', today); + executionDateField.setAttribute('min', today); $('.edit-btn').click(function() { var executionexeField = document.getElementById('execution-record_date');