尝试使用jquery提交表单 [英] Trying to submit a form with jquery
问题描述
我在提交表单时遇到问题。我把它填满了。表格如下:
I am having trouble submitting a form. I have filled it out. The form starts like:
<form action="?&v=b&fv=b&" name="f" enctype="multipart/form-data" method="POST">
我尝试过的变种:
$(document).ready(function(){
$('form[name="f"]').submit();
});
有人可以告诉我一些其他技术将表格发回服务器吗?
Could someone advise me on some other techniques to post the form back to the server?
编辑:抱歉,为简洁起见,我截断了部分操作字符串。我不想让事情复杂化,但我正在使用幻影js开发测试,我正在尝试进入受密码保护的网站,填写表格并以编程方式提交。我已经能够获得前两个工作,但我无法提交表格。
edit: sorry I truncated part of the action string for the sake of brevity. I didn't want to over complicate things but I am working with phantom js to develop a test and I am trying to enter a password protected website , fill out the form and submit it programatically. I've been able to get the first 2 things working, but I can't submit the form.
推荐答案
你想要吗?将这些值发回服务器?你想要做的事情令人困惑。
Do you want to post those values back to the server? It is confusing what you want to do.
<form action="" name="f" enctype="multipart/form-data" method="POST">
<input type="hidden" name="aa" value="b" />
<input type="hidden" name="cbc" value="c" />
</form>
$(document).ready(function(){
$('form[name="f"]').submit();
});
这篇关于尝试使用jquery提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!