Vijayakrishnan 4 жил өмнө
parent
commit
e4c061c368

+ 8 - 1
resources/views/app/patient/manage-appointment.blade.php

@@ -74,7 +74,7 @@
                        placeholder="(optional)">
             </div>
             <div class="mb-3">
-                <button class="btn btn-sm btn-primary d-block w-100 font-weight-bold">
+                <button class="btn btn-sm btn-primary d-block w-100 font-weight-bold apply-appt-button" disabled>
                     @if($appointment && $appointment->uid)
                         Update Appointment
                     @else
@@ -135,6 +135,7 @@
                         $('.appt-form td.stag-selected').removeClass('stag-selected');
                         $(info.dayEl).addClass('stag-selected');
                         $('.appt-form [name="date"]').val(info.dateStr.substr(0, 10));
+                        $('.apply-appt-button').prop('disabled', false);
                     },
                     eventClassNames: function(arg) {
                         @if($appointment && $appointment->uid)
@@ -171,6 +172,7 @@
                         if(_data && _data.success) {
                             @if($appointment && $appointment->uid)
                                 toastr.success('Appointment updated successfully');
+                                $('.apply-appt-button').prop('disabled', true);
                             @else
                                 toastr.success('Appointment booked successfully');
                             @endif
@@ -186,11 +188,16 @@
                                 @else
                                     toastr.error('Unable to book appointment!');
                                 @endif
+
                             }
                         }
                     }, 'json');
                     return false;
                 });
+
+                $(document).on('change input paste', '.appt-form-col *', function() {
+                    $('.apply-appt-button').prop('disabled', false);
+                });
             }
             addMCInitializer('patient-manage-appointment', init);
         })();