title: Success message after submitting form using jQuery Form Plugin with Spring MVC
body: <p>I'm trying to show a succes message after submitting a form. I use jQuery form plugin from <a href="http://malsup.com/jquery/form/" rel="nofollow">link</a></p>
  
  <p>and submitting works fine. Just like that :</p>
  
  <pre><code>$('#emailForm').ajaxForm();
  </code></pre>
  
  <p>Now I would like to add a succes message under a submit button, so I added a div below :</p>
  
  <pre><code>&lt;input name="submit" type="submit" value="#springMessage('action.save')" /&gt;
  
                  &lt;div id="emailSuccessMessage"&gt;
  
                  &lt;/div&gt;
  </code></pre>
  
  <p>and add some changes to the jQuery code :</p>
  
  <pre><code>        var options = { 
          target:        '#emailSuccessMessage',  
          success:       showResponse 
  
      }; 
  
  $('#emailForm').ajaxForm(options); 
  
  function showResponse(responseText, statusText)  { 
      alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 
          '\n\nThe output div should have already been updated with the responseText.'); 
  } 
  </code></pre>
  
  <p>My Controller method is :</p>
  
  <pre><code>@RequestMapping(value = "/password", method = RequestMethod.POST)
      public String changePassword(@Valid @ModelAttribute("editPassword") EditPasswordForm editPasswordForm, BindingResult result) {
          if (result.hasErrors()) {
              return "editAccount";
          }
  
          userService.changePassword(editPasswordForm);
  
          return "editAccount";
      } 
  </code></pre>
  
  <p>Now when I try to submit, it works but no alert is shown ( I added an alert just to test). How does the showResponse method works? I'm new to jQuery and I would like to know how can I achieve my goal. Where should I set the responseText?</p>
  
  <p>Thank</p>
  
  <p>Dawid</p>