Report on successful departure of form



  • The annex to the asp.net mvc5 contains a form to fill, upon application for submission, verification of compulsory fields (in the client area) and if everything is well served. If the checks were passed and everything was fine, there was a message on the screen that the form was sent. How can you do that? ?

    This is the test:

    function validateForm() {
            var x = document.forms["myForm"]["1"].value;
            if (x == null || x == "") {
                alert('Необходимо заполнить поле 1');
                return false;
            }
            var y = document.forms["myForm"]["2"].value;
            if (y == null || y == "") {
                alert('Необходимо заполнить поле 2');
                return false;
            }
    }
    


  • On your server, HTTPPOST uniform method, there you return RedirectToAction.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2