I did the following function in wordpress in the file functions.php
:
function trick_change_checkout_field_input_type() {
echo "<script>document.getElementById('billing_phone').type = 'number';</script>";
}
add_action( 'woocommerce_after_checkout_form', 'trick_change_checkout_field_input_type');
And it worked perfect to force the phone to numbers only, now I need to do the same but for only letters in the name and surname of the checkout form.
How to do it?