input text 強制轉大寫 or 小寫

1
2
<input type="text" name="hostname" onblur="this.value = this.value.toLowerCase();">
<input type="text" name="macaddress" onblur="this.value = this.value.toUpperCase();">