当光标还在text域的时候,你可以按提交按钮啊,反正你一次只能提交一个form

解决方案 »

  1.   

    搞这么多form干吗,一个form,然后多定义些变量不就行了,晕倒!
      

  2.   

    <input type="text" name="ysjg" size="20" maxlength="30"  onfocus="this.style.backgroundColor='#FFFFFF';this.form.submit2.disabled=false;this.form.submit3.disabled=false;" onblur="this.style.backgroundColor='#C0C0C0';this.form.submit2.disabled=true;this.form.submit3.disabled=true;" style="background-color: #C0C0C0;color:rgb(0,0,0);" value="adfaf">
    这段代码里面的这句:
    this.form.submit2.disabled=true;this.form.submit3.disabled=true;
    使提交按钮失效,你要想不失效就不要这句即可
      

  3.   

    to:
    bzscs(沙虫 湖南找工作) 多谢!!
    可当我按下提交按钮时,没有提交,状态:提交按钮一直按着,好像死机一样!!
    请再指点!!to:
    VisualSW(程序员和钳工是一个工种)
    多谢!!
    可我现在需要这个功能!!不好意思!!to:
    ydr2002(killzhfkiller)去掉不行啊,我就是想只有一个提交按钮可以按啊!!
      

  4.   

    把onfocus 放到<form  >里面看看
      

  5.   

    将不同的FORM及Input等依次取不同的名字,尽管内容相同。
      

  6.   

    to:
    patchclass(黑翼) 不行啊!!
    问题没解决,请大家帮忙!!
      

  7.   

    to:
    johnsuna(缘来是e)
    我不能改名的,必须一样!!
      

  8.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document"><title>New Page 2</title>
    </head>
    <script language=javascript>
    var theCurrentFocusForm=null;
    function changeCurrentFocusForm(formObj)
    {
    if(formObj==theCurrentFocusForm) return;
    if(theCurrentFocusForm!=null)
    {
    theCurrentFocusForm.submit2.disabled=true;
    theCurrentFocusForm.submit3.disabled=true;
    }
    theCurrentFocusForm=formObj;
    theCurrentFocusForm.submit2.disabled=false;
    theCurrentFocusForm.submit3.disabled=false;
    }</script>
    <body onload="document.forms[0].ysjg.select();document.forms[0].ysjg.focus();">
    N个FORM(所有内容都一样),N不定,从数据库中取值,怎么样才能按到提交按钮??<br>
    现在的只要光标一离开name为ysjg的text框,提交按钮就失效了??<br>
    应改怎么改?
    多谢!!
    <form name="form1">
    <input type=submit value="提交" name="submit2" onclick="alert('提交')" disabled>
    <input type=button value="dfasf" onClick="window.open()" name="submit3" disabled>
    <input type="text" name="ysjg" size="20" maxlength="30"  onfocus="this.style.backgroundColor='#FFFFFF';changeCurrentFocusForm(this.form);" onblur="this.style.backgroundColor='#C0C0C0';" style="background-color: #C0C0C0;color:rgb(0,0,0);" value="adfaf">
    </form><form name="form1">
    <input type=submit value="提交" name="submit2" onclick="alert('提交')" disabled>
    <input type=button value="dfasf" onClick="window.open()" name="submit3" disabled>
    <input type="text" name="ysjg" size="20" maxlength="30"  onfocus="this.style.backgroundColor='#FFFFFF';changeCurrentFocusForm(this.form);" onblur="this.style.backgroundColor='#C0C0C0';" style="background-color: #C0C0C0;color:rgb(0,0,0);" value="adfaf">
    </form><form name="form1">
    <input type=submit value="提交" name="submit2" onclick="alert('提交')" disabled>
    <input type=button value="dfasf" onClick="window.open()" name="submit3" disabled>
    <input type="text" name="ysjg" size="20" maxlength="30"  onfocus="this.style.backgroundColor='#FFFFFF';changeCurrentFocusForm(this.form);" onblur="this.style.backgroundColor='#C0C0C0';" style="background-color: #C0C0C0;color:rgb(0,0,0);" value="adfaf">
    </form>
    </body></html>