PHP and AJAX form submit

Pinterest LinkedIn Tumblr
<form action="" class="contact_form" id="comment">
    <div id="result">
  <div class="form-group">
    <label for="name">Name*
    <input type="name" class="form-control" name="name" placeholder="Type Here">
  <div class="form-group">
    <label for="organization">Organization name
    <input type="text" class="form-control" name="organization_name" placeholder="xyz">
  <div class="form-group">
    <label for="email">Email*
    <input type="email" class="form-control" name="email" placeholder="[email protected]">
  <div class="form-group">
    <label for="sel1">Service you provide
    <select class="form-control" name="service_provider">
  <div class="checkbox">
      <input type="checkbox">
      <span class="label_span">I accept the terms and conditions. T&C
  <button type="submit" class="btn btn-default btn_submit">Submit

After Html Part Just put ajax request

        dataString = $("#comment").serialize();
            type: "POST",
            url: "db.php",
            data: dataString,
            success: function(data){
                $("#result").html('Successfully updated record!');
                $("#result").addClass("alert alert-success");
                setTimeout(function() {
        return false;  //stop the actual form post !important!
<style media="screen">
    .sss {
        display: none;

1 Comment

  1. Aw, this was an incredibly nice post. Spending some time and actual effort to make a really good article…
    but what can I say… I put things off a lot and don’t manage to get nearly anything done.

Write A Comment