Search code examples
twitter-bootstrapwysiwyg

bootstrap wysiwyg: how to get the formatted text on the server side?


I am learning Bootstrap and would like to have a wysiwyg editor. I found bootstrap-wysiwyg and want to use it.

http://mindmup.github.io/bootstrap-wysiwyg/

However, I cannot figure out how to get formatted text on the server-side when a form is submitted.


Solution

  • I found out how to do this. Here is how.

    A hidden input or textarea field is needed. This field may have the name attribute set to the name of an object's field. Its name must be something the server-side expects.

    Use JQuery to attach a form submit event handler to the form containing the wysiwyg editor. The handler takes the text from the wysiwyg editor and set it as the hidden field's value.

    Hope this helps to someone else.