team2 (Lung Care Programme) Remove Doctor Fix
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m13s Details

This commit is contained in:
zeeshan 2026-11-21 17:02:41 +05:30
parent 729bfeac96
commit c16d4e2d3e
1 changed files with 2 additions and 1 deletions

View File

@ -595,7 +595,7 @@
// Add another doctor wrapper. The first wrapper is already present in the form. // Add another doctor wrapper. The first wrapper is already present in the form.
$('#adddoctor-btn').on('click', function () { $('#adddoctor-btn').on('click', function () {
if ($('.doctor-wrapper').length >= 10) return; if ($('.doctor-wrapper').length >= 5) return;
const doctorOptions = $('#field-contact_id').html(); const doctorOptions = $('#field-contact_id').html();
doctor_count++; doctor_count++;
@ -667,6 +667,7 @@
// Remove a dynamically added doctor wrapper without reusing its element IDs. // Remove a dynamically added doctor wrapper without reusing its element IDs.
$(document).on('click', '.btn-remove', function () { $(document).on('click', '.btn-remove', function () {
doctor_count--;
const $wrapper = $(this).closest('.doctor-wrapper'); const $wrapper = $(this).closest('.doctor-wrapper');
$wrapper.find('select').each(function () { $wrapper.find('select').each(function () {
if ($(this).hasClass('select2-hidden-accessible')) $(this).select2('destroy'); if ($(this).hasClass('select2-hidden-accessible')) $(this).select2('destroy');