日期:2014-05-16 浏览次数:20467 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
  <input name="num" type="text" id="num" onchange='change()' value='10'/>
</form>
<script>
    function change() {
        form1.submit();
    }
</script>
</body>
</html>
------解决方案--------------------
<script type="text/javascript">
function  ss(){
  document.forms[0].submit();
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
 <input name="num" type="text" id="num"  value="1" onchange="ss()"/>
</form>
</body>
</html>
这样?
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload = function() {
    document.getElementById('num').onchange = function() {
        var d = this.value;
        if (!/^[0-9\uFF10-\uFF19]+$/.test(d)) alert('非法数据');
        else {
            d = d.replace(/[\uFF10-\uFF19]+?/g, function(n) {
                return String.fromCharCode(n.charCodeAt(0) - 65248);
            });
            this.value = d;
            this.form.submit();
        }
    }
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
  <input name="num" type="text" id="num" />
</form>
</body>
</html>