ASP.NET MVC3 Client side validation without form tag
ajax, asp.net-mvc-3, jquery, jquery-validate
Solution
No, the jquery validation plugin only works on forms contained by a form tag. There are two methods that you might call to validate you fields
$('some_selector').validate()
$('some_selector').valid()
neither of these will work without a form tag
Problem
I have a view which contains some input fields. They are bound to a viewmodel. They also have validation messages. But the view doesn't have a form tag (neither Ajax.BeginForm nor Html.BeginForm). The user enters some input, selects (via checkboxes) some rows from a table and then clicks a button. I have handled this button's click event on the client side and written an AJAX call to send data to server. This works fine, except the client side validation. Since I have no form tag, the client side validation is ignored. Is there any way to validate user input and show error messages if necessary, without using form tag?