Created
December 8, 2020 11:43
-
-
Save matheuswd/c30fa2f1de28c0b5b6574c03099339c3 to your computer and use it in GitHub Desktop.
Limits the ZIP Code field for 5 digits only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_give_limit_zip_length() { ?> | |
<script> | |
let zipcodes = document.querySelectorAll('input#card_zip'); | |
zipcodes.forEach(zipcode => zipcode.setAttribute('maxlength', 5)); | |
</script> | |
<?php } | |
add_action( 'give_donation_form_after_submit', 'my_give_limit_zip_length' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment