I am embedding tinymce [http://www.tinymce.com/] in twitter bootstrap form , so that user can input formatted text which I can persist to a postgres database.
The problem I am facing is that I get plain text on submit of the form. Can someone help me get the formatted text as a string that I can persist and echo to the html page .
Here is my code [Note:It uses HAML]
%html{:lang => "en"}
%head
%meta{:charset => "utf-8"}
%link{:href => "//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css", :rel => "stylesheet"}
%script{:src => "//tinymce.cachefly.net/4.0/tinymce.min.js"}
:javascript
tinymce.init({selector:'textarea_format'});
%body
.container
%legend Post a New Job
.well
%form#signup.form-horizontal{:action => "submit", :method => "post"}
%legend
.control-group
%label.control-label Title
.controls
.input-prepend
%span.add-on
%i.icon-user
%input#title.input-xxlarge{:name => "title", :placeholder => "Title", :type => "text"}/
.control-group
%label.control-label Description Formatted
.controls
.input-prepend
-#%span.add-on
-#%i.icon-user
%textarea_format#message.input-xlarge.span6{:name => "message_formatted", :rows => "10"}
.control-group
%label.control-label
.controls
%button.btn.btn-success{:type => "submit"} Submit
Seems like I can use tinyMCE.get('content id').getContent() but I am not sure how ?
I am very new to java-script . Can someone please post the required code change and some explanation.
Thanks