在JQuery对话框中提交HTML表单

编程入门 行业动态 更新时间:2024-10-27 10:29:35
本文介绍了在JQuery对话框中提交HTML表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图转换现有的HTML表单,并使其显示在JQuery对话框中。我不确定如何更改代码,以便点击提交按钮后提交数据。我的代码如下:

I am trying to convert an existing HTML form and make it appear in JQuery dialog. I am not sure how to change the code so the data is submitted after clicking the submit buton. My code is a follows:

旧形式:

Old form:

<form method="post" name="callbackrequest" id="ccallbackrequest" action="action.php" onsubmit="return validateThis(this)"> <button type="submit" class="submit">Submit Request</button>

新表格:

New form:

buttons: { "Submit": function() { if ( bValid ) { HERE GOES THE CODE! $( this ).dialog( "close" ); }

然后是新的表单:

Then there is the new form:

<form class="center" method="post" name="callbackrequest" id="ccallbackrequest" action="??"> fields listed no submit button </form>

任何关于如何处理这个问题的建议?

Any advice on how should I handle this?

推荐答案

尝试 $('#ccallbackrequest')。submit(); 。 submit方法只提交选择器返回的任何一个。

Try $('#ccallbackrequest').submit();. The submit method just submits whichever from is returned by the selector.

更多推荐

在JQuery对话框中提交HTML表单

本文发布于:2023-10-11 13:54:07,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   对话框中   JQuery   HTML

发布评论

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

>www.elefans.com

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