可以将表单ID作为JQuery的参数传递吗?

编程入门 行业动态 更新时间:2024-10-23 23:30:48
本文介绍了可以将表单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的参数传递吗?

本文发布于:2023-07-31 15:42:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1260026.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   参数   ID   JQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!