I am playing around with using the WMD Editor (http://wmd-editor.com/) in my site. I have a really simple question. When I am ready to submit the text to the server; how do I get the output of the editor?
Something like this only returns the 'actual text that user typed in the textarea'
var jtext = document.getElementById('myTextarea').value;
I would like to get the 'output' of the editor; but I can't figure out how to do that :(
By output; I mean the 'Markdown' or 'Html' output.
You will need to use javascript to get the contents of the preview div. Based on the demo on the wmd site, the div in question has the class wmd-preview. Not sure why it's not id'd.
In jQuery, you'd use something like:
$('#formname').submit(function() {
$('#hidden_form_element').val($('.wmd-preview').html());
return true;
});