mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:36:38 +08:00
Show basic validation error only for required fields
Otherwise it may trigger on some sites when the field is no longer required but still marked as invalid, e.g. after switching to a country without required state
This commit is contained in:
parent
1558f05361
commit
7f42fe1882
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ const bootstrap = () => {
|
|||
requiredFields.each((i, input) => {
|
||||
jQuery(input).trigger('validate');
|
||||
});
|
||||
if (jQuery('form.woocommerce-checkout .woocommerce-invalid:visible').length) {
|
||||
if (jQuery('form.woocommerce-checkout .validate-required.woocommerce-invalid:visible').length) {
|
||||
errorHandler.clear();
|
||||
errorHandler.message(PayPalCommerceGateway.labels.error.js_validation);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue