Like kristoffer says, probably best to use the style, and convert serverside.
There's also a jQuery plugin to force uppercase:
http://plugins.jquery.com/plugin-tags/uppercase
<html>
<head>
<style>
input.upc { text-transform: uppercase; }
</style>
<script>
// thanks 2 'm2pc' : http://www.webdeveloper.com/forum/showpost.php?s=9f258cba84d461026bb9ed478e86776d&p=423545&postcount=3
function doGetCaretPosition (oField) {
var iCaretPos = 0;
if (document.selection) // IE Support
{
oField.focus ();
var oSel = document.selection.createRange ();
// Move selection start to 0 position
oSel.moveStart ('character', -oField.value.length);
// The caret position is selection length
iCaretPos = oSel.text.length;
}
else
if (oField.selectionStart || oField.selectionStart == '0') // Firefox support
iCaretPos = oField.selectionStart;
return (iCaretPos);
}
function doSetCaretPosition (oField, iCaretPos)
{
if (document.selection) // IE Support
{
oField.focus ();
var oSel = document.selection.createRange ();
oSel.moveStart ('character', -oField.value.length);
oSel.moveStart ('character', iCaretPos);
oSel.moveEnd ('character', 0);
oSel.select ();
}
else
if (oField.selectionStart || oField.selectionStart == '0') // Firefox support
{
oField.selectionStart = iCaretPos;
oField.selectionEnd = iCaretPos;
oField.focus ();
}
}
function forceupper(o)
{
var x = doGetCaretPosition(o);
o.value=o.value.toUpperCase();
doSetCaretPosition(o,x);
}
</script>
</head>
<body>
<form method="get" target="#">
Fld 1 : browser shows upper-case, form submits mixed-case<br>
<input name="f1" id="idf1" class="upc" type="text" value="X"><br>
Fld 2 : javascript updates text to uppercase, form submits uppercase<br>
<input name="f2" id="idf2" class="js" type="text" value="Y" onkeyup="forceupper(this);"><br>
<input type="submit" value="send">
</form>
</body>
</html>