我对JQuery完全陌生。jquery对话框后值到php页面
我想获得一个解决方案,如何将值从一个jQuery对话框形式传递到一个PHP文件进行处理。
请参考this link作为一个例子的jquery dialog form
请注意:该对话框形式的实例将值传递到一个表和显示器。在我的情况下,我想将它们传递给另一个页面(.php文件)。
你的帮助是非常赞赏:)
代码: -Script
if(bValid)
{
$.post("scripts/appointment.php",{ name: name.val(),
email: email.val(),
contact: contact.val(),
file: filenumber.val(),
reason: reason.val(),
app_date: appdate.val(),
time: apptime().val,
visit: getRadioValue()},
function(data){
$("#dialog-form").slideUp("normal", function() {
$("#dialog-form").before('<h1>Success</h1><p>Your Appointment was sent.</p>');
}); }
);
$(this).dialog("close");
}
- 形式
<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>
你的代码在哪里? – DevZer0
嗨DevZer0,我的问题上的链接将带你到代码。但我明白你为什么现在问这个问题......让我发布完整的代码。谢谢。 – 21stking
@ 21stking它会带你到jQuery UI的代码,而不是你的 – vladkras