The saveHTML()
method you used does not seem to save the value to the textarea
element. And because the browser doesn't care about YUI Editor and just submits what is there already in the textarea
(which is null), it submits the input as null..
You should set the value of the textarea
to the editor value so the browser will submit that value instead of null.. Which can be achieved using this little line:
document.getElementsById("msgpost").value = html;
See this working JsFiddle I made for you.
However you had HTML
syntax errors too. The onSubmit
attribute should be on the form
element not the submit button.
And listening to the event is not practical when you can simply call a function when the form submits.. (See the JsFiddle)