weixin_33701251 2010-06-23 15:07 采纳率: 0%
浏览 33

JavaScript自动提交表格

I have a form that I need to submit automatically... (the fields are already filled and its complicated to explain why but it IS necessary to do it this way).. I know how to autosubmit the form using Javascript but the only problem I have is that there is more than 1 submit button.. and I need 1 in particular to be submitted... thanks in advance

EDIT2(source):

<I put the javascript in the head... />
<FORM ACTION="PDF.php" name="form" METHOD="post">
<A whole bunch of inputs />
<INPUT TYPE="submit" name="form-save" VALUE="Save Changes" >
<INPUT TYPE="submit" name="form-submit" VALUE="Submit" >
<input type="submit" name="print" id="print" value="Download PDF" />
</form>
  • 写回答

4条回答 默认 最新

  • 10.24 2010-06-23 15:09
    关注
    $("#yourbuttonid").click();
    

    EDIT:

    <form>
        ... 
       <input type="submit" id="myFirstsubmit" /> 
       <input type="submit" id="mysubmit" /> 
    </form> 
    <script type="text/javascript">  
        $(document).ready(function(){$("#mysubmit").click();}); 
    </script>
    
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码