jquery对话框将值发布到php页面

jquery对话框将值发布到php页面,php,jquery,forms,modal-dialog,Php,Jquery,Forms,Modal Dialog,我对JQuery完全陌生 我想得到一个关于如何将值从jquery对话框表单传递到php文件进行处理的解决方案 请参考以下示例: 请注意:对话框表单的示例将值传递到表并显示。在我的例子中,我希望将它们传递到另一个页面(.php文件) 非常感谢您的帮助:) 代码: -剧本 if(bValid) { $.post(“scripts/appointment.php”,{name:name.val(), 电子邮件:email.val(), 联系人:contact.val(), 文件:filenumber.

我对JQuery完全陌生

我想得到一个关于如何将值从jquery对话框表单传递到php文件进行处理的解决方案

请参考以下示例:

请注意:对话框表单的示例将值传递到表并显示。在我的例子中,我希望将它们传递到另一个页面(.php文件)

非常感谢您的帮助:)

代码: -剧本

if(bValid)
{
$.post(“scripts/appointment.php”,{name:name.val(),
电子邮件:email.val(),
联系人:contact.val(),
文件:filenumber.val(),
原因:reason.val(),
应用程序日期:appdate.val(),
时间:apptime().val,
访问:getRadioValue()},
功能(数据){
$(“#对话框形式”).slideUp(“正常”,函数(){
$(“#对话框表单”)。之前('Success您的约会已发送。

'); }); } ); $(此).dialog(“关闭”); }
-形式


请填写预约表。
如果 预订不可用,我们将通知您

第一次参观? 是


档案编号。 你来访的原因是什么? 名称 电子邮件 联络电话。 日期 时间
这意味着您必须绑定书本按钮上的单击事件:

$('#bookButton').click(function() {
    // perfom check
    if (bValid) {
        // other code
    }
});

嗨,DevZer0,我的问题的链接将带你到代码。但我明白你为什么现在问这个。。。让我发布完整的代码。谢谢。@21stking它将带您访问jQuery UI的代码,而不是yours@vladkras我现在已经发布了我的代码,你可以检查一下。@21stking ok,这个代码怎么了?你有错吗?@vladkras,我没有错。当我点击“Book”按钮时,什么也没有发生,表单甚至保持打开状态,但没有关闭。当我单击“Book”按钮时,我希望将值传递到scripts/aappoint.php文件。我的按钮有一个事件处理程序,它可以工作,问题在于将我的值发布到另一个页面。i、 在if(bvalid){//other code}中,我已经找出了问题所在。问题在于我试图传递的值(name.val()、email.val()等)。。当我硬编码这些值时,效果很好,但当我引用它们时,它们就不起作用了
<div id="dialog-form" title="Make an appointment">
  <p class="validateTips">Please fill in the form to book an appointment.<br>If the
  booking is not available we will notify you!</p>

   <form>
     <fieldset>
       <label for="patient"><b>First Time Visit?</b></label>
     <input type="radio" name="patient" id="patient_state" value="Yes">Yes<br>
 <input type="radio" name="patient" id="patient_state" value="No">No<br><hr>
<label for="filenumber">File No.</label>
<input type="text" name="filenumber" id="filenumber" value="" class="text ui-widget-content ui-corner-all" />
<label for="reason">What's your reason for visit?</label>
<input type="text" name="reason" id="reason" value="type reason here..." class="text ui-widget-content ui-corner-all" />
<label for="name">Name</label>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
<label for="email">Email</label>
<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
<label for="contact">Contact No.</label>
<input type="text" name="contact" id="contact" value="" class="text ui-widget-content ui-corner-all" />
<label for="appdate">Date</label>
<input type="text" name="appdate" id="datepicker" value="" class="text ui-widget-content ui-corner-all" />
<label for="apptime">Time</label>
 <input type="text" name="apptime" id="apptime" value="HH:MM" class="text ui-widget-  
 content ui-corner-all" />
  </fieldset>
 </form>
</div>
$('#bookButton').click(function() {
    // perfom check
    if (bValid) {
        // other code
    }
});