1

I'm using this code to limit max number of characters to a determined field... is it possible to force UPPERCASE?

Here's what I'm using:

add_action("wp_footer", "cod_set_max_length");

function cod_set_max_length(){
    if( !is_checkout())
    return;
    ?>
    <script>
    jQuery(document).ready(function($){
        $("#cracha_empresa").attr('maxlength','33');
        $("#cracha_primeironome").attr('maxlength','12');
        $("#cracha_sobrenome").attr('maxlength','26');
        // more fields
    });
    </script>
    <?php
}
0

1 Answer 1

0

You could do a couple things.

Use JS toUpperCase() to transform the text.

var upper = text.toUpperCase();

Or just use CSS to do it.

#yourID {
    text-transform: uppercase;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.