I have a simple form with a select element and an input element. Depending on the value in the select element i might or might not need the input element validated.
What i did is, i set the 'data-val' attribute on the input element to either 'true' or 'false' depending on what is selected in the select element. This part is working - i can inspect the value of the attribute in firebug and it does change according to the plan.
Now, in order to have the jquery unobtrusive validation to notice the change in the dom i call
$.validator.unobtrusive.parse(document)
I tried passing the form or the element, so i guess passing the document is actually just my latest attempt. I tried passing the jquery object of the form, as well as the dom-form element. I also tried validating only the input element calling
$.validator.unobtrusive.parseElement(myElement)
Again, i tried with the jquery object as well as the 'nekid dom element'.
What am i missing here?