My modal is not showing. the page is reloading and then i receive an email.
Below you can find my code. Can somebody help me out please... I think the problem is that my page is reloading after clicking the submit button.
Below my form that i use :
<form id="form" method="post" name="form" autocomplete="on">
<div class="row">
<div class="col-sm-6 nopadding-right">
<div class="input-group">
<div class="input-group-addon"><span class="fa fa-user"></span></div>
<input type="text" name="vname" placeholder="Name" class="form-control requiredField name" value="" />
</div>
<div class="input-group">
<div class="input-group-addon"><span class="fa fa-phone"></span></div>
<input type="text" name="vphone" placeholder="Phone" class="form-control requiredField phone" value="" />
</div>
<div class="input-group">
<div class="input-group-addon"><span class="fa fa-at"></span></div>
<input type="email" name="vmail" placeholder="Enter email" class="form-control requiredField email" value="" />
</div>
</div>
<div class="col-sm-6">
<div class="input-group mail-block">
<div class="input-group-addon"><span class="fa fa-pencil"></span></div><textarea class="form-control message" name="vtext" placeholder="Message" rows="4"></textarea><input class="btn btn-primary inverse-btn" id="send" name="confirm" type="submit" value="send">
</div>
</div>
</div>
</form>
The modal :
<div class="modal fade" id="Modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Thank you</h4>
</div>
<div class="modal-body">
<p>Thanks for getting in touch!</p>
</div>
</div>
</div></div>
My php code :
<?php if(isset($_POST["confirm"])){ if($_POST["vname"]==""||$_POST["vmail"]==""||$_POST["vphone"]==""||$_POST["vtext"]==""){
echo "error";}else{
$email=$_POST['vmail'];
$email =filter_var($email, FILTER_SANITIZE_EMAIL);
$email= filter_var($email, FILTER_VALIDATE_EMAIL);
if (!$email){
echo "error";
}
else{
$subject = "mail " . $_POST['vname'];
$message = $_POST['vtext'] . "\r\n" . ' phone ' . $_POST['vphone'] ."\r\n" . $_POST['vmail'];
$headers = 'From:'. "xxx#email.com" . "\r\n"; // Sender's Email
$headers .= 'Cc:'. "xxx#email.com" . "\r\n"; // Carbon copy to Sender
$message = wordwrap($message, 70);
mail("xxx.yy#xxx.com", $subject, $message, $headers);
echo "<script type='text/javascript'>
$(document).ready(function(){
$('#Modal').modal('show');
});
</script>";
}
}
}?>
The remedy is to use AJAX call instead of form submission. It allows you to do better error handling as well.
Related
I have a form in Bootstrap that's inside a modal. When I click the "Submit"
there is seems nothing happen,
I have checked the code for the typo and other errors and it seems nothing wrong with my php code but again every time I fill the form and hit the submit button the page is reloaded but email/data not posted
here is the complete php code :
<?php
if(isset($_POST['Submit'])){
$to = 'Support#example.com'; // this is your Email address
$from = $_POST['faq-contact-email'];// this is the sender's Email address
$first_name = $_POST['faq-contact-firstname'];
$last_name = $_POST['faq-contact-lastname'];
$division = $_POST['faq-contact-subject'];
$subject = $_POST['contact-subject'];
$themessage = $_POST['faq-contact-msg'];
$message = 'Support mail from : '.$first_name.' '.$last_name.'<br/>
To : '.$division.' Division<br/>
<hr/>
'.$themessage.'';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: ".$from."\r\n"."X-Mailer: php";
mail($to,$subject,$message,$headers);
echo "Support message Sent. Thank you " . $first_name . ", we will contact you shortly.";
}
?>
<div class="content">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#faq4" href="#faq4_q1"><i class="fa fa-envelope-o"></i> Contact Support</a>
</h3>
</div>
<div id="faq4_q1" class="panel-collapse collapse in">
<div class="panel-body">
<form method="post" action="" class="form-horizontal push-10-t" >
<div class="form-group">
<div class="col-xs-6 col-sm-4">
<div class="form-material form-material-primary">
<input class="form-control" type="text" id="faq-contact-firstname" name="faq-contact-firstname" placeholder="Enter your firstname..">
<label for="faq-contact-firstname">Firstname</label>
</div>
</div>
<div class="col-xs-6 col-sm-4">
<div class="form-material form-material-primary">
<input class="form-control" type="text" id="faq-contact-lastname" name="faq-contact-lastname" placeholder="Enter your lastname..">
<label for="faq-contact-lastname">Lastname</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-8">
<div class="form-material form-material-primary input-group">
<input class="form-control" type="email" id="faq-contact-email" name="faq-contact-email" placeholder="Enter your email..">
<label for="faq-contact-email">Email</label>
<span class="input-group-addon"><i class="fa fa-envelope-o"></i></span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<div class="form-material form-material-primary">
<select class="form-control" id="faq-contact-subject" name="faq-contact-subject" size="1">
<option value="1">Tech Support</option>
<option value="2">Billing</option>
</select>
<label for="faq-contact-subject">Where?</label>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4">
<div class="form-material form-material-primary">
<input class="form-control" type="text" id="contact-subject" name="contact-subject" placeholder="Enter your subject..">
<label for="contact-subject">Subject</label>
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<div class="form-material form-material-primary">
<textarea class="form-control" id="faq-contact-msg" name="faq-contact-msg" rows="7" placeholder="Enter your message.."></textarea>
<label for="faq-contact-msg">Message</label>
</div>
<div class="help-block text-right">Feel free to use common tags: <blockquote>, <strong>, <em></div>
</div>
</div>
<div class="form-group remove-margin-b">
<div class="col-xs-12">
<button class="btn btn-sm btn-primary" name="submit" type="submit"><i class="fa fa-send push-5-r"></i> Send Message</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
Can anyone please help me what's wrong with my code
If someone could help that would be greatly appreciated!
Thanks
Ok, I make an answer of my comment.
if(isset($_POST['Submit']))
Change Submit to submit. You can also use
if(isset($_POST))
instead
Check your first line
if(isset($_POST['Submit']))
You have written "Submit" (capital S) ,where the name of your button is "submit" . so make it
if(isset($_POST['submit']))
<div class="col-lg-10 col-lg-offset-1 text-center">
<form method="POST" action="index.php" accept="text/html" formenctype="multipart/form-data" class="contact-form row">
<div class="col-md-4">
<label></label>
<input name="name" type="text" class="form-control" placeholder="Name">
</div>
<div class="col-md-4">
<label></label>
<input name="email" type="text" class="form-control" placeholder="Email">
</div>
<div class="col-md-4">
<label></label>
<input name="subject" type="text" class="form-control" placeholder="Subject">
</div>
<div class="col-md-12">
<label></label>
<textarea name="message" class="form-control" rows="9" placeholder="Your message here.."></textarea>
</div>
<div class="col-md-4 col-md-offset-4">
<label></label>
<button id="submit" name="submit" type="sumbit" data-toggle="modal" data-target="#alertModal" class="btn btn-primary btn-block btn-lg">Send <i class="ion-android-arrow-forward"></i></button>
</div>
</form>
</div>
</div>
</div>
</section>
<div id="alertModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-body">
<h2 class="text-center">Submitted sucessfully!</h2>
<p class="text-center">You clicked the button</p>
<br/>
<button class="btn btn-primary btn-lg center-block" data-dismiss="modal" aria-hidden="true">OK <i class="ion-android-close"></i></button>
</div>
</div>
</div>
</div>
<?php
$headers = ''; // added this line
$headers. = "MIME-Version: 1.0\r\n";
$headers. = "Content-type: text/html\r\n";
$headers = 'From: $name'.
"\r\n". // added .= instead of =
'X-Mailer: PHP/'.phpversion();
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: '.$email;
$to = 'random#gmail.com';
$subject = $_POST['subject'];
$body = " From: $name\n E-mail: $email\n Subject: $subject\n Message:\n $message";
if (isset($_POST['submit'])) {
/* Anything that goes in here is only performed if the form is submitted */
if (mail('random#gmail.com', $subject, $body, $from)) {
echo "<script type='text/javascript'>$(document).ready(function(){ $('#alertModal').modal('show');});</script>";
} else {
echo "something went wrong";
}
} ?>
I have been trying to call my modal when submitting my form, but cannot seem to get it to work.
I have been looking at various different questions but nothing seems to work.
I do not have JS for this and my PHP is incorporated on a separate page.
Please help, I want the modal to open on the same page as the form when someone submits the info.
Thanks
See , it is working
function showModal(){
$('#alertModal').modal('show');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="col-lg-10 col-lg-offset-1 text-center">
<form method="POST" action="index.php" accept="text/html" formenctype="multipart/form-data" class="contact-form row">
<div class="col-md-4">
<label></label>
<input name="name" type="text" class="form-control" placeholder="Name">
</div>
<div class="col-md-4">
<label></label>
<input name="email" type="text" class="form-control" placeholder="Email">
</div>
<div class="col-md-4">
<label></label>
<input name="subject" type="text" class="form-control" placeholder="Subject">
</div>
<div class="col-md-12">
<label></label>
<textarea name="message" class="form-control" rows="9" placeholder="Your message here.."></textarea>
</div>
<div class="col-md-4 col-md-offset-4">
<label></label>
<button id="submit" name="submit" type="sumbit" data-toggle="modal" data-target="#alertModal" class="btn btn-primary btn-block btn-lg">Send <i class="ion-android-arrow-forward"></i></button>
</div>
</form>
</div>
</div>
</div>
</section>
<div id="alertModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-body">
<h2 class="text-center">Submitted sucessfully!</h2>
<p class="text-center">You clicked the button</p>
<br/>
<button class="btn btn-primary btn-lg center-block" data-dismiss="modal" aria-hidden="true">OK <i class="ion-android-close"></i></button>
</div>
</div>
</div>
</div>
<?php
$headers = ''; // added this line
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html\r\n";
$headers = 'From: $name' . "\r\n" . // added .= instead of =
'X-Mailer: PHP/' . phpversion();
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: ' . $email;
$to = 'random#gmail.com';
$subject = $_POST['subject'];
$body = " From: $name\n E-mail: $email\n Subject: $subject\n Message:\n $message";
if (isset($_POST['submit']))
{
/* Anything that goes in here is only performed if the form is submitted */
if (mail ('random#gmail.com', $subject, $body, $from ))
{
echo "<script type='text/javascript'>showModal();</script>";
} else
{
echo "something went wrong";
}
}
?>
you have two choice
change button type:
<button type="button" class="btn btn-primary btn-lg center-block" data-dismiss="modal" aria-hidden="true">OK <i class="ion-android-close"></i></button>
call function:
<form method="POST" action="index.php" accept="text/html" formenctype="multipart/form-data" class="contact-form row" onSubmit="show_modal();return;">
and the function:
function show_modal(){
$('#myModal').modal('show');
}
UPDATE (requested in comments)
Set timer for submit form after delay:
Change button type to button: type="button"
add this code to your page:
$("#submit").click(function(){
setTimeout(function() {
$("form").submit();
}, 5000); // 5 sec
$("#myModal").show(); //Find your modal id and replace with myModal
});
Note: don't forget to include jquery lib
I am working on a site, and having never done something like this, I am unsure how to proceed with PHP. I am working with bootstrap and looking to send an email based on a modal. My HTML looks like
<div class="modal fade" id="contact" role="dialoge">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Plan your Party!</h4>
</div>
<form class="name" name="contact">
<div class="modal-body">
<div class="form-group">
<label for="name" class="col-lg-2 control-label">Name:</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="name" required="required" placeholder="Full Name">
</div>l
</div>
<div class="form-group">
<label for="email" class="col-lg-2 control-label">Email:</label>
<div class="col-lg-10">
<input type="email" class="form-control" name="email" required="required" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="message" class="col-lg-2 control-label">Message:</label>
<div class="col-lg-10">
<textarea class="form-control" rows="8" style="resize: vertical;" required="required" placeholder="Message" name="message"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" data-dismiss="modal"><i class="glyphicon glyphicon-remove"></i> Close</button>
<button class="btn btn-success" type="submit" id="submit"><i class="glyphicon glyphicon-inbox"></i> Submit</button>
</div>
</div>
</div>
</div>
So I am just wondering if anyone could give me some pointers to make this form actually send the email. I am looking to learn and willing to try anything. Thanks in advance, help and constructful criticism appreciated. Also, how would I approach adding a confirmation that the message has been sent?
Thanks, John.
<script>
$(document).ready(function () {
$("input#submit").click(function(){
$.ajax({
type: "POST",
url: "process.php", //
data: $('form.contact').serialize(),
success: function(msg){
$("#thanks").html(msg)
$("#form-content").modal('hide');
},
error: function(){
alert("failure");
}
});
});
});
</script>
This is the script I tried to add to call the php:
<?php
$myemail = 'myemail#myemail.ca';
if (isset($_POST['name'])) {
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$message = strip_tags($_POST['message']);
echo "<span class=\"alert alert-success\" >Your message has been received. Thanks! Here is what you submitted:</span><br><br>";
echo "<stong>Name:</strong> ".$name."<br>";
echo "<stong>Email:</strong> ".$email."<br>";
echo "<stong>Message:</strong> ".$message."<br>";
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n ".
"Email: $email\n Message \n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email";
mail($to,$email_subject,$email_body,$headers);
}
?>
And I mean I am sure there is something I am missing, or some simple fix, this is all just so new to me.
Following are the edits for you:
1) You have two forms in the modal and none of them having closing form tag. Remove <form class="form-horizontal"> form and change your other form to <form class="contact">
2) Give closing form tag.
3) Change submit button to <button class="btn btn-success" id="submit"><i class="glyphicon glyphicon-inbox"></i> Submit</button>
4) Also check updated AJAX code and PHP code.
Hope this should help you..
HTML
<div id="thanks"> </div>
<p>
<a data-toggle="modal" href="#contact"
class="btn btn-primary">Contact us</a>
</p>
<!-- model content -->
<div class="modal hide fade in" style="display: none; " id="contact" >
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Plan your Party!</h4>
</div>
<form class="contact">
<div class="modal-body">
<div class="form-group">
<label for="name" class="col-lg-2 control-label">Name:</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="name" required="required" placeholder="Full Name">
</div>
</div>
<div class="form-group">
<label for="email" class="col-lg-2 control-label">Email:</label>
<div class="col-lg-10">
<input type="email" class="form-control" name="email" required="required" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="message" class="col-lg-2 control-label">Message:</label>
<div class="col-lg-10">
<textarea class="form-control" rows="8" style="resize: vertical;" required="required" placeholder="Message" name="message"></textarea>
</div>
</div>
</div>
</form>
<div class="modal-footer">
<button type="button" class="btn btn-info" data-dismiss="modal"><i class="glyphicon glyphicon-remove"></i> Close</button>
<button class="btn btn-success" id="submit"><i class="glyphicon glyphicon-inbox"></i> Submit</button>
</div>
</div>
</div>
</div>
AJAX
<script>
$(function() {
//twitter bootstrap script
$("button#submit").click(function(){
$.ajax({
type: "POST",
url: "process.php",
data: $('form.contact').serialize(),
success: function(msg){
$("#thanks").html(msg);
$("#contact").modal('hide');
},
error: function(){
alert("failure");
}
});
});
});
</script>
process.php
<?php
$myemail = 'myemail#myemail.ca';
if (isset($_POST['name']))
{
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$message = strip_tags($_POST['message']);
$msg_success = "";
$msg_fail = "Error sending mail.";
$msg_success .= "<span class=\"alert alert-success\" >Your message has been received. Thanks! Here is what you submitted:</span><br><br>";
$msg_success .= "<stong>Name:</strong> ".$name."<br>";
$msg_success .= "<stong>Email:</strong> ".$email."<br>";
$msg_success .= "<stong>Message:</strong> ".$message."<br>";
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n ".
"Email: $email\n Message \n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email";
if(mail($to,$email_subject,$email_body,$headers))
echo $msg_success;
else
echo $msg_fail;
}
else
echo "Input parameters missing";
?>
In form tag include action attribute to point any PHP page, from there you can send emails...
Ok so I have the modal toggling, that is easy with bootstrap. But now, whenever I click submit the form gets redirected to php/contact-process.php. It looks like the php is processed but then just stays at a white screen, and not being redirected and no email is received to my main email(i put example#gmail.com for stackexchange question). Please help me.
<!--Modals for Contact-->
<div class="modal fade" id="contact" role = "dialog">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal contact" name="contact" action="php/contact-process.php">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4>Contact Us</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="contact-name" class="col-lg-2 control-label">Name:</label>
<div class="col-lg-10">
<input type="text" name="name" class="form-control" id="contact-name" placeholder="Full Name">
</div>
</div>
<div class="form-group">
<label for="contact-email" class="col-lg-2 control-label">Email:</label>
<div class="col-lg-10">
<input type="email" name="email" class="form-control" id="contact-email" placeholder="you#example.com">
</div>
</div>
<div class="form-group">
<label for="contact-message" class="col-lg-2 control-label">Message:</label>
<div class="col-lg-10">
<textarea name="usertext" name="message" id="" rows="8" class="form-control" style="resize:none;"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
Close
<button class="btn btn-primary" type="submit" value="Send!">Send</button>
</div>
</form>
</div>
</div>
</div>
CONTACT-PROCESS.PHP:
<?php
//add the recipient's address here
$myemail = 'example#gmail.com';
//grab named inputs from html then post to #thanks
if (isset($_POST['name'])) {
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$message = strip_tags($_POST['message']);
//generate email and send!
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n ".
"Email: $email\n Message \n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email";
mail($to,$email_subject,$email_body,$headers);
//redirect
header("Location: index.php");
exit();
}
?>
I have a modal on my page, with a contact form in it. Anyway, the fields like mail should be required but it just sends it right away, even when the fields aren't filled in... How is that possible?
The Modal:
<div class="modal fade" id="form-content" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border-bottom: none;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Contact</h4>
</div>
<div class="modal-body">
<form class="contact" name="contact">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input type="text" name="name" class="form-control" placeholder="Name" required="required">
</div>
<br/>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
<input type="email" name="email" class="form-control" placeholder="Mail">
</div>
<br/>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-globe"></i></span>
<input type="url" name="website" class="form-control" placeholder="Website">
</div>
<br/>
<textarea rows="6" name="message" class="form-control" placeholder="Message"></textarea>
</form>
</div>
<div class="modal-footer" style="border-top: none;">
<input class="btn btn-success" type="submit" value="Send!" id="submit">
</div>
</div>
</div>
</div>
PHP script:
<?php
$myemail = 'mail#mail.nl';
if (isset($_POST['name'])) {
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$message = strip_tags($_POST['message']);
$website = strip_tags($_POST['website']);
echo "<br><span style=\"display:table; margin:0 auto;\" class=\"alert alert-success\" id=\"alert-message\" data-alert=\"alert\">Your message has been received. Thank you!</span>";
$to = $myemail;
$email_subject = "Contact formulier van: $name";
$email_body = "Je hebt een nieuw bericht ontvangen via het contactformulier. ".
"Hier zijn de de details:\n Naam: $name \n ".
"Email: $email\n Website: $website \n Bericht: \n $message";
$headers = "From: $email\n";
$headers .= "Reply-To: $email";
mail($to,$email_subject,$email_body,$headers);
}?>
EDIT:
I also hava a main.js, to show the people the form has been sended:
$(document).ready(function () {
$("input#submit").click(function(){
$.ajax({
type: "POST",
url: "process.php", //
data: $('form.contact').serialize(),
success: function(msg){
$("#thanks").html(msg)
$("#form-content").modal('hide');
$('#thanks').delay(3000).fadeOut()
},
error: function(){
alert("failure");
}
});
});
});
You missed the action and method in your form: action="yourpage.php" method="POST"
Where action refers to your php page and method to the way you send data, in this case POST as in your PHP code you have $_POST['name'] (etc).
Also the Submit should be inside the Form tag, not outside.
Something like this:
<div class="modal fade" id="form-content" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border-bottom: none;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Contact</h4>
</div>
<div class="modal-body">
<form class="contact" name="contact">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input type="text" name="name" class="form-control" placeholder="Name" required="required">
</div>
<br/>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
<input type="email" name="email" class="form-control" placeholder="Mail">
</div>
<br/>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-globe"></i></span>
<input type="url" name="website" class="form-control" placeholder="Website">
</div>
<br/>
<textarea rows="6" name="message" class="form-control" placeholder="Message"></textarea>
<div class="modal-footer" style="border-top: none;">
<input class="btn btn-success" type="submit" value="Send!" id="submit">
</div>
</form>
</div>
</div>
</div>
Ref: http://www.w3schools.com/tags/tag_form.asp
You have to mention form method and action in form open tag. After then check the output.
for example, Form structure should be like,
<form name="input" action="demo_form_action.asp" method="get">
Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>