TycheSoftwares / order-delivery-date-for-woocommerce

WooCommerce Delivery Date Lite
8 stars 5 forks source link

Remove the red styling when the correct date has entered in the delivery date field. #387

Open Chetna1510 opened 3 years ago

Chetna1510 commented 3 years ago

Describe the bug Remove the red styling when the correct date has been entered in the delivery date field. The client's requirement: When you try to submit the checkout form without selecting a date on the calendar, the field e_deliverydate_field, receives both classes “woocommerce-invalid” and “wocommerce-invalid-required-field” (the field is marked with an error on it). Afterwards, if you select a valid date, the both classes remains on the field, so the user still believes that there is an error,even if the form allow the submission.

When I confirmed the above, the client mentioned that :

That’s correct! Even when the red notice at the top of the page must remains, the field needs to loose the red styling.

To Reproduce See the video: https://drive.google.com/file/d/1cbYFIkYywJVGvJoEmtw2tVqNo0qkuT4A/view

It's working fine in PRO version as the same way the client wants: https://drive.google.com/file/d/1W_CfbcJmwg6G6yW-y0YSmZgEoCrciL8r/view

Additional context https://wordpress.org/support/topic/bug-at-required-field-notice/

The (partial) solution I found is to change the following function “orddd_on_select_date” at “js/orddd-lite-initialize-datepicker.js” byadding the folowing lines at the end of function:

jQuery( “#e_deliverydate_field” ).removeClass(‘woocommerce-invalid’); jQuery( “#e_deliverydate_field” ).removeClass(‘woocommerce-invalid-required-field’); //jQuery( “#e_deliverydate_field” ).addClass(‘woocommerce-validated’);