代码如下:
<script language="javascript">
// -----------------------------
// 本函数用于自动将输入文本框中的内容转换成大写字符
// -----------------------------
function JHshToUpperCase() {
if ((window.event.keyCode >= 97) && (window.event.keyCode <= 122)) {
window.event.keyCode = window.event.keyCode - 32 ; } }
//--------------------------------------
// 本函数用于限制文本输入框中只能输入数字"0"到"9",".","-"
//--------------------------------------
function JHshNumberText()
{
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57))
|| (window.event.keyCode == 13) || (window.event.keyCode == 46)
|| (window.event.keyCode == 45)))
{
window.event.keyCode = 0 ;
}
}
// -------------------------------------------
// 本函数用于自动将输入文本框中的内容转换成小写字符
// Edit www.jb200.com
// ------------------------------------------
function JHshToLowerCase() {
if ((window.event.keyCode >= 65) && (window.event.keyCode <= 90)) {
window.event.keyCode = window.event.keyCode + 32 ;
}
}
</script>