Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. if (Request.IsAjaxRequest())
  2. {
  3. return Content("/receipt/latest");
  4. }
  5. else
  6. {
  7. return RedirectToAction("latest", "receipt");
  8. }
  9.  
  10. function manageResponse(responseText, statusText) {
  11. if (responseText.toString().substr(0, 1) == '/') {
  12. window.location = responseText;
  13. }
  14. else {
  15. $("#formResult").text(responseText);
  16. }
  17. }
  18.  
  19. var options = {
  20. beforeSubmit: function() {
  21. return $('#login').validate().form();
  22. },
  23. success: manageResponse
  24. };
  25.  
  26. $('#login').validate(); // setup form to use validation plugin
  27.  
  28. var options = {
  29. beforeSubmit: function() {
  30. return $('#login').valid(); // check form is valid
  31. },
  32. success: manageResponse
  33. };
Add Comment
Please, Sign In to add comment