function test(obj)
{
}<form name="test1" onsubmit="test(this)">
</form>
<form name="test2" onsubmit="test(this)">
</form>

解决方案 »

  1.   

    seabell(百合心) 不行呀,还有其他方法吗?
      

  2.   

    想修改自己的什么东西呢?这样?
      function test(x) {
    var obj=eval(x.name);
    obj.txt.value="fadsfassafasfasdf";
    // obj.submit(); //这句放开就可以提交当前表单
      }<form name="test1" action="#">
    <input type="text" name="txt">
    <input type="button" onClick="test(form)" value="提交">
    </form><form name="test2" onsubmit="test(this)">
    <input type="text" name="txt">
    <input type="button" onClick="test(form)" value="提交">
    </form>