A really simple way of doing this is to use javascript or jQuery. It's probably not the best way, but it's simple. A much better alternative would be to use CSS and convert to uppercase using php, but it's not as simple as this.
You can create a new file in includes/modules/pages/product_info/jscript_capitals.js and put this inside:
Code:
function attribUppercase(e)
{
var charInput = e.keyCode;
if((charInput >= 97) && (charInput <= 122)) { // lowercase
if(!e.ctrlKey && !e.metaKey && !e.altKey) { // no modifier key
var newChar = charInput - 32;
var start = e.target.selectionStart;
var end = e.target.selectionEnd;
e.target.value = e.target.value.substring(0, start) + String.fromCharCode(newChar) + e.target.value.substring(end);
e.target.setSelectionRange(start+1, start+1);
e.preventDefault();
}
}
}
window.onload = function() {
document.getElementById("attrib-110-0").addEventListener("keypress", attribUppercase, false);
}
Notice the part in red - check if your element has that exact ID and change if needed (right-click the input field -> Inspect Element).
Bookmarks