admin管理员组文章数量:1122832
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
}
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
}
Share
Improve this question
edited May 29, 2019 at 17:49
LoicTheAztec
3,38117 silver badges24 bronze badges
asked May 29, 2019 at 14:39
Daniel GonçalvesDaniel Gonçalves
111 bronze badge
0
1 Answer
Reset to default 0You 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;
}
本文标签: jqueryForce uppercase on some WooCommerce checkout fields input
版权声明:本文标题:jquery - Force uppercase on some WooCommerce checkout fields input 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736296000a1929691.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论