0

Well, before asking here I have tried to find an answer for the issue I work with. Maybe someone who knows will help to find solution. I'm using bootstrap framework and here I have a "send friend" button which shows a modal fill-in form.

here's link: http://codepen.io/anon/pen/bNvOPB?editors=100

If fill out the form and press submit, it should send the data to the recipient. `

$name = $_POST["name"];
$email = $_POST["email"];
$sub ="$name, look this ";
$mes = "<b><u>Hi, $name.</u></b><p>text</p>";

$verify = mail ($email,$sub,$mes,"Content-type:text/html; charset = utf-8");

?>`

Individually all works fine, but if join together, the data don't come? Please, help with sending data and back to modal as a confirmation.

I tried to solve this by myself for several days, but now I give up.

Bogdan
  • 85
  • 1
  • 3
  • 9

1 Answers1

0

change

      <button type="submit" name="submit" class="btn btn-sm" data-dismiss="modal" aria-hidden="true">Send</button> 

to

      <button type="submit" name="submit" class="btn btn-sm" >Send</button> 

plus if you want to get a confirmation . try submiting the form via ajax. and get success as json response basis on which u can show the message and close the modal.

Vishal Wadhawan
  • 1,085
  • 1
  • 9
  • 11
  • thanks a lot, now works. I wonder if you may help with back to modal as a confirmation.? – Bogdan Feb 20 '15 at 18:09
  • you can send the content like this $("button").click(function(){ $.post("demo_test_post.asp", { name: "Donald Duck", city: "Duckburg" }, function(data, status){ if(data == success) }); }); – Vishal Wadhawan Feb 20 '15 at 18:14
  • here is example just send the data using ajax. http://www.w3schools.com/jquery/jquery_ajax_get_post.asp and then return something when the email goes. – Vishal Wadhawan Feb 20 '15 at 18:15
  • great. well basically the above problem was because data-dismiss"modal" causes the modal to close so the other actions ddnt perform... :) – Vishal Wadhawan Feb 20 '15 at 18:29