本文介绍了可以将表单ID作为JQuery的参数传递吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好专家, 我想在按钮点击时将表单作为参数传递。 以下是我试过的内容 我不能说这个因为这有价值高级搜索 我其实想通过表格TireQuickSearch 按钮提交中的id和动作及其方法。
Hello experts, I want to pass form as parameter on button click. Below is what I tried I cannot say "this" Because this has value "Advanced Search" I actually want to pass form "TireQuickSearch" id and action and its method in button submit.
<form id="formNewTireSearch" runat="server"> In this form I have ASP:Dropdown Drop down lists Cascading drop downs </form>
<form id="TireQuickSearch" action="DealerTireSearchResults.aspx" method="post" > <input type="hidden" name="FormAction" value="TireQuickSearch" /> <input type="button" name="SearchButton" value="Advanced Search" onclick="return ValidateTireQuickSearch(form id="TireQuickSearch" action="DealerTireSearchResults.aspx" method="post");" /> </form>
可以有人帮我请
Can anyone help me please
推荐答案将这个传递给该函数,并使用 表单属性 [ ^ ]访问父< form> 标记。 Pass this to the function, and use the form property[^] to access the parent <form> tag. function ValidateTireQuickSearch(theButton) { var theForm = theButton.form; ... }
或者,将 this.form 传递给函数:
Or, pass this.form to the function:
<input type="button" name="SearchButton" value="Advanced Search" onclick="return ValidateTireQuickSearch(this.form);" />
试试这个: Try this: <!DOCTYPE html> <html> <head> <script src="ajax.googleapis/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script>
(document).ready(function(){ (document).ready(function(){
更多推荐
可以将表单ID作为JQuery的参数传递吗?
发布评论