Jquery ajax php only working once

JvlshZ

New Member
I have the following jQuery\[code\] $("button#submit").click(function(){ $.ajax({ type: "POST", url: "process.php", data: $('form.contact').serialize(), success: function(msg){ $("#form-content").modal('hide'); $("#thanks").html(msg); $("#thanks").delay(2000).fadeOut("slow"); }, error: function(){ alert("failure"); } }); });\[/code\]And Php\[code\]<?php if (isset($_POST['name'])) { $name = strip_tags($_POST['name']); $email = strip_tags($_POST['Email']); $sug = strip_tags($_POST['sug']); echo "<span class='label label-info'>Your Website has been submitted .. Thank you</span>";}?>\[/code\]This works the first time and displays the php echo on my page. But when I submit the form again it does not show.
 
Back
Top