Menu icon Foundation
Foundation form unexpected token

Ive followed a tutorial and tried to adapt it to Foundation 5 and nothing works
when i try to run it and i check the console i get
"Uncaught SyntaxError: Unexpected token } " then when i click the form nothing happens.

<!doctype html>
<html class="no-js" lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Foundation | Welcome</title>
  <link rel="stylesheet" href="css/foundation.css" />
  <link rel="stylesheet" href="css/style.css" />
  <script src="js/vendor/modernizr.js"></script>
</head>
<body>
<div >
<form id = "myForm" data-abide="ajax"> 
<div class = "contactform">

<div class="name-field">
<label>Your name <small>required</small> 
<input id = "name" type="text" required > 
</label> 
<small class="error">Name is required</small> 
</div> 

<div class="email-field"> 
<label>Email <small>required</small> 
<input id ="email" type="email" required> </label> 
<small class="error">An email address is required.</small>

 </div> 
 
 <div class="text-field"> 
<label>Your Message <small>required</small> 
 </label> 
 <textarea id = "message" required></textarea>
<small class="error">Please enter message</small>

 </div> 
 
 <button type="submit">Submit</button> 
 </div>
 </form>
 </div>
    
    <script src="js/vendor/jquery.js"></script>
    <script src="js/foundation.min.js"></script>

    <script>
      $(document).foundation();
    </script>
	
	<script>
$("#myForm").on('valid', function(e){
           e.preventDefault();
         var name = $("input#name").val();
         var email = $("input#email").val();
         var msg = $("textarea#message").val();

         var dataString = 'name=' + name +
         '&email=' + email +
         '&msg=' + msg;

         $.ajax({
            type:"POST",
            url:"php/mail.php",
            data: dataString,
            success: function(){
               $(".contactform").html("<div id = 'thanks'></div>");
            $('#thanks').html("<h2>Thanks</h2>")
               .append("<p> Dear " + name + " I will contact you soon </p>")
               .hide()
               .fadeIn(1500);
         }
         });
    return false;
      });
	</script>
  </body>
</html>

       
       
       
       
      

<?php
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];

$msg = "
Name:$name
Email:$email
Comment:
$message";

$to = "mail@gmail.com";
$subject = "Form";
$message = $msg;
$headers = "form";
mail($to,$subject,$message,$headers);
?>
            

         

javascriptPHPform

Ive followed a tutorial and tried to adapt it to Foundation 5 and nothing works
when i try to run it and i check the console i get
"Uncaught SyntaxError: Unexpected token } " then when i click the form nothing happens.

<!doctype html>
<html class="no-js" lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Foundation | Welcome</title>
  <link rel="stylesheet" href="css/foundation.css" />
  <link rel="stylesheet" href="css/style.css" />
  <script src="js/vendor/modernizr.js"></script>
</head>
<body>
<div >
<form id = "myForm" data-abide="ajax"> 
<div class = "contactform">

<div class="name-field">
<label>Your name <small>required</small> 
<input id = "name" type="text" required > 
</label> 
<small class="error">Name is required</small> 
</div> 

<div class="email-field"> 
<label>Email <small>required</small> 
<input id ="email" type="email" required> </label> 
<small class="error">An email address is required.</small>

 </div> 
 
 <div class="text-field"> 
<label>Your Message <small>required</small> 
 </label> 
 <textarea id = "message" required></textarea>
<small class="error">Please enter message</small>

 </div> 
 
 <button type="submit">Submit</button> 
 </div>
 </form>
 </div>
    
    <script src="js/vendor/jquery.js"></script>
    <script src="js/foundation.min.js"></script>

    <script>
      $(document).foundation();
    </script>
	
	<script>
$("#myForm").on('valid', function(e){
           e.preventDefault();
         var name = $("input#name").val();
         var email = $("input#email").val();
         var msg = $("textarea#message").val();

         var dataString = 'name=' + name +
         '&email=' + email +
         '&msg=' + msg;

         $.ajax({
            type:"POST",
            url:"php/mail.php",
            data: dataString,
            success: function(){
               $(".contactform").html("<div id = 'thanks'></div>");
            $('#thanks').html("<h2>Thanks</h2>")
               .append("<p> Dear " + name + " I will contact you soon </p>")
               .hide()
               .fadeIn(1500);
         }
         });
    return false;
      });
	</script>
  </body>
</html>

       
       
       
       
      

<?php
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];

$msg = "
Name:$name
Email:$email
Comment:
$message";

$to = "mail@gmail.com";
$subject = "Form";
$message = $msg;
$headers = "form";
mail($to,$subject,$message,$headers);
?>