Stripe checkout is not validating required input fields.
required field:
<input type="tel" name="appointment[patient_phone]" id="appointment_patient_phone" required="required" placeholder="Phone Number">
When I click on the stripe button, the stripe checkout popup appears and form is not validated.
So I tried and add a custom validator but stopPropagation is not working as the stripe checkout popup still pops up after alert and stopPropagation is called
function validateAppointmentForm() {
var validateForm = function(event) {
debugger;
var phone = $('#appointment_patient_phone').val();
if (!phone) {
alert("Phone number is required.");
event.preventDefault();
event.stopPropagation();
}
}
var watchStripeButton = function() {
debugger;
$("#new-appt-stripe-button").on("click", validateForm);
}
debugger;
watchStripeButton();
}
;