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

This commit is contained in:
Tanuja Pansare 2026-09-08 16:05:26 +05:30
parent 01fe2852c2
commit b13af0bbfc
2 changed files with 29 additions and 2 deletions

View File

@ -494,7 +494,7 @@
$select.append($("<option></option>").attr("value", '').text('-- Select --')); $select.append($("<option></option>").attr("value", '').text('-- Select --'));
for (let itm of data) { for (let itm of data) {
const activities = itm?.contact?.doctor_activities_for_neb_2_top_30_next_30_doctors; const activities = itm?.contact?.doctor_activities_for_neb_2_top_30_next_30_doctors;
if (typeof activities !== 'undefined' && activities !== null && activities !== 'Yes') continue; if (activities !== 'Yes') continue;
$select.append( $select.append(
$("<option></option>") $("<option></option>")
.attr("value", itm.value) .attr("value", itm.value)
@ -647,6 +647,7 @@
} }
} }
} }
$('#execution-id').val(selected['id']) $('#execution-id').val(selected['id'])
if (selected['user_id'] && $('#execution-user_id').length) { if (selected['user_id'] && $('#execution-user_id').length) {
@ -720,6 +721,8 @@
$('#execution-other_type_of_meeting').attr('required',false); $('#execution-other_type_of_meeting').attr('required',false);
} }
}) })
// IMPORTANT: trigger AFTER handler is registered
$('#execution-type_of_meeting').trigger('change');
$('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide(); $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide();
$('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false); $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false);
@ -762,6 +765,7 @@
} }
} }
} }
$('#execution-id').val(selected['id']) $('#execution-id').val(selected['id'])
if (selected['user_id'] && $('#execution-user_id').length) { if (selected['user_id'] && $('#execution-user_id').length) {
@ -842,6 +846,8 @@
$('#execution-other_type_of_meeting').attr('required',false); $('#execution-other_type_of_meeting').attr('required',false);
} }
}) })
$('#execution-type_of_meeting').trigger('change');
$('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide(); $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide();
$('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false); $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false);

View File

@ -428,7 +428,28 @@ foreach($questions as $q){
$('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false); $('#field-chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
$('#field-speciality,#field-msl_code').attr('readonly',true); $('#field-speciality,#field-msl_code').attr('readonly',true);
// Hide Other Type of Meeting initially
$('#field-other_type_of_meeting').parent().hide();
$('#field-other_type_of_meeting').attr('required', false);
// Show only when Type of Meeting = Other
$('#field-type_of_meeting').on('change', function () {
if ($(this).val() === 'Other') {
$('#field-other_type_of_meeting').parent().show();
$('#field-other_type_of_meeting').attr('required', true);
} else {
$('#field-other_type_of_meeting').parent().hide();
$('#field-other_type_of_meeting').attr('required', false);
$('#field-other_type_of_meeting').val('');
}
});
// Apply on page load (important for preview/edit)
$('#field-type_of_meeting').trigger('change');
$('#field-pob_type').on('change',function(){ $('#field-pob_type').on('change',function(){
let value=$(this).val(); let value=$(this).val();
console.log("Value is : ",value); console.log("Value is : ",value);