I have JQuery tabs in my view. Each tab contain a partial view. Some of them contain ajax forms with client-side validation. The problem is that validation works only when the tab is seleced at first time. If I select another tab and then select previous tab then client-side validation does not work. Maybe all necessary scripts are not being loaded at the second time? Or something else? Please, help me.
I apologize for the lack of code. I did not post any code just because I have a whole bunch of JQuery UI wrappers and helpers in my project so it will be hard to understand how things are done. All those classes seem to work fine, except this bug I found. If something in this question is not clear then I will try to post some code and markup.
Thanks in advance for your answers.
You may find the following blog post useful. Basically the problem comes from the fact that dynamically added elements to the DOM need to be registered with client validation. This could be achieved using the
Sys.Mvc.FormContext._Application_Load()method which could be invoked immediately after you inject the contents for the new tab after the AJAX call succeeds.