自动单击没有ID的表单上的提交 [英] Automatically click submit on form without ID
本文介绍了自动单击没有ID的表单上的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在页面加载时自动点击此表单上的提交
I want to automatically click submit on this form when the page loads
<form role="form" accept-charset="UTF-8" method="post" action="https://FORMURL.com" novalidate="novalidate"> <div> </div> <div class="row k"> <input type="submit" value="I submitted my ID Docs" class="button button-style w"> </div> <span style="display: none;"></span> </form>
我有什么试过:
我尝试使用此代码,但它需要一个表单ID,我无法访问表单以包含I D。
What I have tried:
I tried using this code but it requires a form ID and I do not have access to the form to include an ID.
<script type="text/javascript">
window.onload = function () {
document.Submit.click();
}
</script>
推荐答案
如果这是页面上唯一的表格
If it's the only form on the page
document.getElementsByTagName("form")[0].submit();
这篇关于自动单击没有ID的表单上的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文