Team 3 Form changes Doctor Activities for Neb 1
Specific Folder FTP Upload / ftp-deploy (push) Successful in 39s Details

This commit is contained in:
Tanuja Pansare 2026-09-08 17:22:46 +05:30
parent b13af0bbfc
commit b82948e9ed
1 changed files with 77 additions and 49 deletions

View File

@ -237,7 +237,10 @@
@if(!isset($option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors) ||
$option->contact->doctor_activities_for_neb_2_top_30_next_30_doctors === null
)
<option value="{{ $option->value }}" speciality="{{isset($option->contact->speciality)?$option->contact->speciality:''}}" msl_code="{{isset($option->contact->msl_code)?$option->contact->msl_code:''}}"
<option value="{{ $option->value }}"
speciality="{{ isset($option->contact->speciality) ? $option->contact->speciality : '' }}"
msl_code="{{ isset($option->contact->msl_code) ? $option->contact->msl_code : '' }}"
doctor_category="{{ isset($option->contact->doctor_activities_for_neb_2_doctor_category) ? $option->contact->doctor_activities_for_neb_2_doctor_category : '' }}"
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
{{ $option->display }}
@ -386,18 +389,7 @@
@endswitch
</div>
@endforeach
<div class="col-md-12 mb-2" id="execution-doctor-category-wrapper" style="display:none;">
<label for="execution-doctor_category" class="form-label">
Doctor Category <span class="text-danger">*</span>
</label>
<select class="form-control" id="execution-doctor_category" name="doctor_category">
<option value=""> -- Select -- </option>
<option value="Top 30">Top 30</option>
<option value="Next 30">Next 30</option>
<option value="Non Believers">Non Believers</option>
</select>
</div>
@if (!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'))
<div class="text-center d-grid mt-3">
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit
@ -501,6 +493,7 @@
.text(itm.display)
.attr("msl_code", itm?.contact?.msl_code ?? '')
.attr('speciality', itm?.contact?.speciality ?? '')
.attr('doctor_category', itm?.contact?.doctor_activities_for_neb_2_doctor_category ?? '')
);
}
if (includeOther) {
@ -526,6 +519,7 @@
.text(itm.display)
.attr("msl_code", itm?.contact?.msl_code ?? '')
.attr('speciality', itm?.contact?.speciality ?? '')
.attr('doctor_category', itm?.contact?.doctor_activities_for_neb_2_doctor_category ?? '')
);
}
}
@ -559,37 +553,53 @@
let value = $(this).val();
if(value === 'other') {
$('#field-doctor_category').parent().show();
$('#field-doctor_category').attr('required', true);
if (value === 'other') {
// Show Doctor Category and allow manual entry
$('#field-doctor_activities_for_neb_2_doctor_category')
.parent().show();
$('#field-doctor_activities_for_neb_2_doctor_category')
.attr('required', true)
.attr('readonly', false);
// Show Other doctor fields
$('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name')
.parent().show();
$('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name')
.attr('required', true);
$('#field-msl_code,#field-speciality').parent().hide();
// Hide normal doctor fields
$('#field-msl_code,#field-speciality')
.parent().hide();
$('#field-msl_code,#field-speciality').attr('required', false);
$('#field-msl_code,#field-speciality')
.attr('required', false);
} else {
// Show normal doctor fields
$('#field-msl_code,#field-speciality')
.parent().show();
$('#field-msl_code,#field-speciality')
.attr('required', true);
// Show fetched Doctor Category as readonly
$('#field-doctor_activities_for_neb_2_doctor_category')
.parent().show();
$('#field-doctor_activities_for_neb_2_doctor_category')
.attr('required', true)
.attr('readonly', true);
// Hide Other doctor fields
$('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name')
.parent().hide();
$('#field-other_msl_code,#field-other_speciality,#field-other_speaker_name')
.attr('required', false);
$('#field-msl_code,#field-speciality').parent().show();
$('#field-msl_code,#field-speciality').attr('required', true);
// Hide Doctor Category
$('#doctor-category-wrapper').hide();
$('#field-doctor_category').attr('required', false);
$('#field-doctor_category').val('');
}
});
@ -603,6 +613,13 @@
$('#field-name_of_the_speaker').change(function() {
$('#field-speciality').val($('option:selected', this).attr('speciality'))
})
$('#field-name_of_the_speaker').change(function() {
$('#field-doctor_activities_for_neb_2_doctor_category').val(
$('option:selected', this).attr('doctor_category') || ''
);
});
$('#field-other_speaker_name').on('input', function () {
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
@ -857,20 +874,30 @@
console.log("Type of Meet without change",type_of_meet);
$('#execution-name_of_the_speaker').change(function() {
$('#execution-msl_code').val($('option:selected', this).attr('msl_code'))
})
$('#execution-name_of_the_speaker').change(function() {
$('#execution-speciality').val($('option:selected', this).attr('speciality'))
})
let selectedOption = $('option:selected', this);
$('#execution-other_speaker_name').change(function() {
$('#execution-other_msl_code').val($('option:selected', this).attr('msl_code'))
})
$('#execution-msl_code').val(
selectedOption.attr('msl_code') || ''
);
$('#execution-other_speaker_name').change(function() {
$('#execution-other_speciality').val($('option:selected', this).attr('speciality'))
})
$('#execution-speciality').val(
selectedOption.attr('speciality') || ''
);
$('#execution-doctor_category').val(
selectedOption.attr('doctor_category') || ''
);
});
$('#execution-other_speaker_name').change(function() {
$('#execution-other_msl_code').val($('option:selected', this).attr('msl_code'))
})
$('#execution-other_speaker_name').change(function() {
$('#execution-other_speciality').val($('option:selected', this).attr('speciality'))
})
})
@ -878,7 +905,7 @@
$('#execution-msl_code,#execution-speciality').attr('readonly',true);
$('#execution-msl_code,#execution-speciality,#execution-doctor_category').attr('readonly',true);
$('#execution-name_of_the_speaker').change(function() {
@ -901,7 +928,7 @@
.attr('required', false);
// Show Doctor Category
$('#execution-doctor-category-wrapper').show();
$('#execution-doctor_category').parent().show();
$('#execution-doctor_category').attr('required', true);
} else {
@ -920,10 +947,11 @@
$('#execution-msl_code,#execution-speciality')
.attr('required', true);
// Hide Doctor Category
$('#execution-doctor-category-wrapper').hide();
$('#execution-doctor_category').attr('required', false);
$('#execution-doctor_category').val('');
// Show fetched Doctor Category
$('#execution-doctor_category').parent().show();
$('#execution-doctor_category').attr('required', true);
$('#execution-doctor_category').attr('readonly', true);
}
});