I've been so frustrated by this I'm going crazy! I have a form that works if you use the submit button on the form.
I'm trying to drop it into a modal jqueryui dialog
so if you remove the input submit button in the html, the jqueryui button starts working, but breaks my action page.
normally the action page sends an email with the contents, then redirects to a thank you page
which is what it does with the html submit button, but using the jqueryui button it prints this:
Â
and doesn't continue
This is the section where the button is initialized
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 400,
width: 350,
modal: true,
buttons: {
"Submit Request": function() {
$("form[name='send']").submit()
$('#send').submit();
$(this).submit();
$('#dialog-form').submit();
and this is the form
<div id="dialog-form" title="Request a Quote">
<p class="validateTips">You are also welcome to call us at </p>
<form id="send" name="send" action="process.php" method="POST">
<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="number">Phone Number</label>
<input type="name" name="contact" id="number" value="" class="text ui-widget-content ui-corner-all" />
<label for="message">Message</label>
<textarea cols="49" rows="6"name="message"/></textarea>
<input name="submit" type="submit" value="submit" >
</form>
</div>
and adding this to the form makes it work
<input name="submit" type="submit" value="Submit" />
but only if you click the html form submit button
This is the action page:
<?php
if(isset($_POST['submit'])) {
$to = '@gmail.com' ; //put your email address on which you want to receive the information
$subject = 'Contact Form'; //set the subject of email.
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = "<table><tr><td>Name: </td><td>".$_POST['name']."</td></tr>
<tr><td>E-Mail: </td><td>".$_POST['email']."</td></tr>
<tr><td>Phone Number: </td><td>".$_POST['contact']."</td></tr>
<tr><td>Message: </td><td>".$_POST['message']."</td>
</tr></table>" ;
mail($to, $subject, $message, $headers);
header('Location: contact_thanks.php');
}
?>