<form name=form1>
<input style="display:none" name=action>
<input type="submit" value="确定" onclick="form1.action.value='A';alert(form1.action.value)" id=submit1 name=submit1>
</form>

解决方案 »

  1.   

    为什么不用 type=hidden<input type="hidden" name=action>
    <input type="submit" value="确定" onclick="form1.action.value='A'"> id=submit1 name=submit1>你所谓的带alert() 功能是什么意思啊?
    onclick="alert('????????')"
    是不是这样啊?
      

  2.   

    没错,我就想还作一个某个text是否为空的判断或者作长度的限制。
      

  3.   

    <form name=form1 onsubmit="return check(this)">
    name:<input name=username>
    <input style="display:none" name=action>
    <input type="submit" value="确定" onclick="form1.action.value='A';" id=submit1 name=submit1>
    </form><script>
    function check(theForm){
    if(theForm.username.value==""){
    alert("名字不能为空");
    theForm.username.select();
    return false;
    }
    return true;
    }
    </script>
      

  4.   

    form1.action.value是什么东东?action是你自己定义的?建议不要用这种名字
      

  5.   

    <input style="display:none" name=action>
    <input type="submit" value="确定" onclick="form1.action.value='A'"> 
    <input type="submit" value="删除" onclick="form1.action.value='D'"> 
    如果我只想在点击确定时触发alert,应该怎么办??
      

  6.   

    <input style="display:none" name=action>
    <input type="submit" name="sure" value="确定" onclick="form1.action.value='A'"> 
    <input type="submit" name="del" value="删除" onclick="form1.action.value='D'"> 
    <script for="sure" event="onClick" Language="javascript">
      alert("名字不能为空");
    </script>
      

  7.   

    <script language=javascript>
    function xb()
    {
    alert("form1.action.value")
    }
    </script>
    <input style="display:none" name=action>
    <input type="submit" value="确定" onclick="form1.action.value='A'","xb()"> 
    <input type="submit" value="删除" onclick="form1.action.value='D'"> 
      

  8.   

    我写错了,应该为:
    <input style="display:none" name=action>
    <input type="submit" name="sure" value="确定" onclick="form1.action.value='A'"> 
    <input type="submit" name="del" value="删除" onclick="form1.action.value='D'"> 
    <script for="sure" event="onClick" Language="vbscript">
      msgBox "你按了确定按钮!"
    </script>