I am using NicEdit as a wysiwig JS editor for a page in my MVC3 project. The field i want an editor for is a textarea and it is a ‘required’ field.
The problem is that the clientside JQuery validation does not ‘see’ the content entered in nicEdit textarea (because nicEdit completely changes the page and the textarea IS empty). How would i fix this? Is there a way to immmediately fill the textarea with the value of the edit box? Can I hook into the JQuery validation in a nice way so things stay ‘unobtrusive’?
Thanks
OK here’s what i’ve come up with. I just added some code to the click handler of the submit button so the nicEditor updates the html before jquery validation kicks in:
Also as a note i had to remove some code from NicEdit.js as it was adding linebreak tags if the content was empty like this:
}
I removed this code so a textarea stays empty.