1

How can I to force the input of the postcode field in WooCommerce account page into upper case, so if someone inputs rh12 3uc it makes it into RH12 3UC?

mujuonly
  • 11,370
  • 5
  • 45
  • 75
3bsstudio
  • 21
  • 4

2 Answers2

1
add_action('wp_footer', 'postcode_toupper');

function postcode_toupper(){
    echo '<script>jQuery(function($) {$("#billing_postcode").keyup(function() {  this.value = $("#billing_postcode").val().toUpperCase();    });});</script>';
}

Add this code in your active theme functions.php

mujuonly
  • 11,370
  • 5
  • 45
  • 75
0

I tend to use CSS text-transform: uppercase;

For the element id 'billing_postcode' use...

#billing_postcode {text-transform: uppercase;}