This must be something simple but after a good few hours I can't, for the life of me, see what it is!
I'm writing a page and I have a section which is editable and this is done using a AJAX form but the client side validation, and server side for that matter, never kicks in. If I look at the HTML I can see the data- attributes have been added but nothing is ever flagged.
@using (Ajax.BeginForm("SaveStats", new AjaxOptions { UpdateTargetId = "profileStats", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" }))
{
@Html.ValidationSummary(false, "Form Errors")
Thats the setup for my form, I haven't included anything else just cos its a normal basic form, but obviously if its needed I'll add it.
Thanks for any help you can give.
* EDIT * Ok I think I understand the problem a bit more now. First Ill try and explain things a bit better. The page I'm working on is a profile page and each section has a edit button which when pressed loads a new partial view, via ajax, which contains a form to allow editing of the details in that section. When the user has finished editing that section they press save and a new partial view is loaded which contains the data but on text only format.
After more googling and looking at the links provided below the problem seems to be that the client side validation isn't aware of the new form I've loaded as its been done via ajax, hence why i'm not getting any client side validation for the form. I can't seem to get the suggestion below to work. Does anyone have any ideas?