In your functions.php include:
add_action("wp_footer", "cod_set_max_length");
function cod_set_max_length(){
if( !is_checkout())
return;
?>
<script>
jQuery(document).ready(function($){
$("#billing_address_1").attr('maxlength','20');
$("#billing_address_2").attr('maxlength','20');
// more fields
});
</script>
<?php
}
add_action("wp_footer", "cod_set_max_length");
function cod_set_max_length(){
if( !is_checkout())
return;
?>
<script>
jQuery(document).ready(function($){
$("#billing_address_1").attr('maxlength','20');
$("#billing_address_2").attr('maxlength','20');
// more fields
});
</script>
<?php
}
WooCommerce - Set Maxlength to checkout field
Reviewed by webmission
on
11:11
Rating:
No comments:
Post a Comment