[英]JQuery Onclick clear action value before submitting
I have a form: 我有一个表格:
<form id="Myform" action="something here" method="post">
...
<input type="image" src="submit.png" id="mysubmit" name="submit" />
What I need the action value of the form to cleared before it submits. 我需要在提交之前清除表单的操作值。
How could I do that in JQuery? 我怎么能在JQuery中做到这一点?
$("#Myform").submit(function(){
$(this).attr("action","");
});
I think what you are looking for is 我认为你在寻找的是
$('MyForm').on('submit', function(){
$(this).attr('method', '');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.