PDA

View Full Version : Force upper case in text fields



TheHammer
02-17-2014, 01:36 PM
Anyone know how to force uppercase in text fields (product options)? I got it to force int he display on the product page by modifying the styles.css, but it still passes lower case to the cart. I need it to be uppercase all the way thru

swilliams
02-17-2014, 02:41 PM
If using CSS, that will just change how it appears. It will not impact the data submitted. If you want to actually make it uppercase so that it carries through later, you would have to use javascript to convert it at some point.

TheHammer
02-17-2014, 02:51 PM
dammit, i suck at javascript. i'll post here for everyone once i muddle my way through it

Marc_NY
02-17-2014, 03:36 PM
Add to any article on the onepagecheckout page.



<script type="text/javascript">
jQuery(function(){
jQuery('input#btnSubmitOrder').click(function(){
jQuery('input[name^="Orders.Custom_Field"]').each(function(){
this.value = this.value.toUpperCase();
});
return true;
});
});
</script>