title: JQuery form submit Question?
body: <p>I'm kind of new to JQuery and was wondering how can I have the following text appear when the user submits there changes <code>&lt;p&gt;Your changes have been saved.&lt;/p&gt;</code>? How do I fix my code so it displays this message?</p>
  
  <p>JQuery script.</p>
  
  <pre><code>$(function() {
  
  $(".save-button").click(function() {
      $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) {
          $("div.contact-info-form").html(html);
      });
      return false; // prevent normal submit
  });
  
  });
  </code></pre>
  
  <p>Here is the html.</p>
  
  <pre><code>&lt;div id="contact-info-form" class="form-content"&gt;
  
  &lt;h2&gt;Contact Information&lt;/h2&gt;
  &lt;form method="post" action="index.php" id="contact-form"&gt;
  &lt;fieldset&gt;
  &lt;ul&gt;
  &lt;li&gt;&lt;label for="address"&gt;Address 1: &lt;/label&gt;&lt;input type="text" name="address" id="address" size="25" class="input-size" value="&lt;?php if (isset($_POST['address'])) { echo $_POST['address']; } else if(!empty($address)) { echo $address; } ?&gt;" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;label for="address_two"&gt;Address 2: &lt;/label&gt;&lt;input type="text" name="address_two" id="address_two" size="25" class="input-size" value="&lt;?php if (isset($_POST['address_two'])) { echo $_POST['address_two']; } else if(!empty($address_two)) { echo $address_two; } ?&gt;" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;label for="city_town"&gt;City/Town: &lt;/label&gt;&lt;input type="text" name="city_town" id="city_town" size="25" class="input-size" value="&lt;?php if (isset($_POST['city_town'])) { echo $_POST['city_town']; } else if(!empty($city_town)) { echo $city_town; } ?&gt;" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;label for="state_province"&gt;State/Province: &lt;/label&gt;
  &lt;?php
  
  echo '&lt;select name="state_province" id="state_province"&gt;' . "\n";
    foreach($state_options as $option) {
      if ($option == $state_province) {
        echo '&lt;option value="' . $option . '" selected="selected"&gt;' . $option . '&lt;/option&gt;' . "\n";
      } else {
        echo '&lt;option value="'. $option . '"&gt;' . $option . '&lt;/option&gt;'."\n";
      }
    }
  echo '&lt;/select&gt;';
  
  ?&gt;
  &lt;/li&gt;
  
  &lt;li&gt;&lt;label for="zipcode"&gt;Zip/Post Code: &lt;/label&gt;&lt;input type="text" name="zipcode" id="zipcode" size="5" class="input-size" value="&lt;?php if (isset($_POST['zipcode'])) { echo $_POST['zipcode']; } else if(!empty($zipcode)) { echo $zipcode; } ?&gt;" /&gt;&lt;/li&gt;
  
  &lt;li&gt;&lt;label for="country"&gt;Country: &lt;/label&gt;
  &lt;?php
  
  echo '&lt;select name="country" id="country"&gt;' . "\n";
    foreach($countries as $option) {
      if ($option == $country) {
        echo '&lt;option value="' . $option . '" selected="selected"&gt;' . $option . '&lt;/option&gt;' . "\n";
      } 
      else if($option == "-------------") {
        echo '&lt;option value="' . $option . '" disabled="disabled"&gt;' . $option . '&lt;/option&gt;';
      }
      else {
        echo '&lt;option value="'. $option . '"&gt;' . $option . '&lt;/option&gt;'."\n";
      }
    }
  echo '&lt;/select&gt;';
  
  ?&gt;
  &lt;/li&gt;
  
  &lt;li&gt;&lt;label for="email"&gt;Email Address: &lt;/label&gt;&lt;input type="text" name="email" id="email" size="25" class="input-size" value="&lt;?php if (isset($_POST['email'])) { echo $_POST['email']; } else if(!empty($email)) { echo $email; } ?&gt;" /&gt;&lt;br /&gt;&lt;span&gt;We don't spam or share your email with third parties. We respect your privacy.&lt;/span&gt;&lt;/li&gt;
  
  &lt;li&gt;&lt;p&gt;Changes have been saved&lt;/p&gt;&lt;input type="submit" name="submit" value="Save Changes" class="save-button" /&gt;
      &lt;input type="hidden" name="contact_info_submitted" value="true" /&gt;
  &lt;input type="submit" name="submit" value="Preview Changes" class="preview-changes-button" /&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/fieldset&gt;
  
  &lt;/form&gt;
  
  &lt;/div&gt;
  </code></pre>