不想提交的元素,你在提交的时候用javascript把对应的input的disabled属性设为true,就不会提交了。document.form1.text1.disabled = true;

解决方案 »

  1.   

    给你个函数,解决你第二个问题:
    function regInput(obj, reg, inputStr) {
    var docSel = document.selection.createRange()
    if (docSel.parentElement().tagName != "INPUT") return false
    oSel = docSel.duplicate()
    oSel.text = ""
    var srcRange = obj.createTextRange()
    oSel.setEndPoint("StartToStart", srcRange)
    var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
    return reg.test(str)
    }如下使用:
    <input name="rDoc_recCount" type="text" class="input2" onkeypress = "return regInput(this,/^[0-9]*$/,String.fromCharCode(event.keyCode))" onpaste = "return regInput(this,/^[0-9]*$/, window.clipboardData.getData('Text'))" ondrop = "return regInput(this,/^[0-9]*$/,event.dataTransfer.getData('Text'))" style="ime-mode:Disabled">
      

  2.   

    用下面的代码:
    <SCRIPT LANGUAGE="JavaScript">
      //<!--
      function onlynumber(str)//判断是否只是数字
      {
      var i,strlength,tempchar;
       strlength=str.length;
       for(i=0;i<strlength;i++)
        {
         tempchar=str.substring(i,i+1);
          if(!(tempchar==0||tempchar==1||tempchar==2||tempchar==3||tempchar==4
          ||tempchar==5||tempchar==6||tempchar==7||tempchar==8||tempchar==9))
           {
             alert('只能输入数字');
             str="1";
             break;
            }
         }
        return str;
        }
      //-->
    +++++
    不想把部分信息提交,可以用楼上的这位大哥的方法
      

  3.   

    if(document.form1.text1.value == document.form1.text1.defaultValue){
        document.form1.text1.disabled = true;
    }onkeypress
    onblur
      

  4.   

    第三个问题出来了。怎么能够在这里面,控制焦点的位置,我在输入一个成绩之后,enter
    能不能条转到下一个输入
      

  5.   

    对于第三个问题,一个简单例子:
    <html>
    <head>
    <title> New Document </title>
    </head>
    <script language="JavaScript">
    <!--
    window.document.attachEvent("onkeydown" ,  function(){
    if(window.event.keyCode==13){
    window.event.keyCode = 9;
    }
    });
    //-->
    </script>
    <body>
    <table>
    <tr>
    <td><input type="text" name=""></td>
    <td><input type="text" name=""></td>
    </tr>
    <tr>
    <td><input type="text" name=""></td>
    <td><input type="text" name=""></td>
    </tr>
    </table>
    </body>
    </html>
      

  6.   

    补充一下楼上的
    <table>
    <tr>
    <td><input type="text" name=""></td>
    <td><input type="text" name=""></td>
    <td><a href="#" tabIndex="-1">oo</a></td>
    </tr>
    <tr>
    <td><input type="text" name=""></td>
    <td><input type="text" name=""></td>
    <td><a href="#" tabIndex="-1">00</a></td>
    </tr>
    </table>tabIndex--------------------------------------------------------------------------------DescriptionSets the tab index for the object. Syntax
    object.tabIndex[ = tabIndex]
    ResTab selection order is determined by the value of tabIndex as follows: All elements with tabIndex > 0 are selected in increasing tab index order, or in source order for duplicate tab index values. 
    All elements with tabIndex = 0, or without tabIndex set, are selected next, in source order if more than one. 
    Elements with tabIndex = -1 are omitted from tabbing order. 
    This property has read-write permissions, meaning you can change as well as retrieve its current value. Applies ToA, APPLET, AREA, BODY, BUTTON, DIV, EMBED, HR, IFRAME, IMG, INPUT, MARQUEE, OBJECT, SELECT, TABLE, TEXTAREA