So I have a WYSIWYG. Now I wanted to know how can I post the value of that editor.
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>A WYSIWYG Rich Text Editor with contentEditable attribute</title>
<link rel='stylesheet prefetch' href='https://netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css'>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<link href='https://fonts.googleapis.com/css?family=Dosis|Candal' rel='stylesheet' type='text/css'>
<br>
<br>
<div class="toolbar">
<a href="#" data-command='undo' title="Undo"><i class='fa fa-undo' ></i></a>
<a href="#" data-command='redo' title="Redo"><i class='fa fa-repeat' ></i></a>
<!---
<div class="fore-wrapper"><i class='fa fa-font' style='color:#C96;'></i>
<div class="fore-palette">
</div>
</div>
<div class="back-wrapper"><i class='fa fa-font' style='background:#C96;'></i>
<div class="back-palette">
</div>
</div>
--->
<a href="#" data-command='bold' title="Bold"><i class='fa fa-bold' ></i></a>
<a href="#" data-command='italic' title="Italic"><i class='fa fa-italic' ></i></a>
<a href="#" data-command='underline' title="Underline"><i class='fa fa-underline' ></i></a>
<a href="#" data-command='strikeThrough' title="Strike Through"><i class='fa fa-strikethrough' ></i></a>
<a href="#" data-command='justifyLeft' title="Justify Left"><i class='fa fa-align-left' ></i></a>
<a href="#" data-command='justifyCenter' title="Justify Center"><i class='fa fa-align-center'></i></a>
<a href="#" data-command='justifyRight' title="Justify Right"><i class='fa fa-align-right' ></i></a>
<a href="#" data-command='justifyFull' title="Justify Full"><i class='fa fa-align-justify' ></i></a>
<a href="#" data-command='indent' title="Indent"><i class='fa fa-indent' ></i></a>
<a href="#" data-command='outdent' title="Outdent"><i class='fa fa-outdent' ></i></a>
<a href="#" data-command='insertUnorderedList' title="Ordered List"><i class='fa fa-list-ul' ></i></a>
<a href="#" data-command='insertOrderedList' title="Unordered List"><i class='fa fa-list-ol'></i></a>
<a href="#" data-command='h1'>H1</a>
<a href="#" data-command='h2'>H2</a>
<a href="#" data-command='createlink' title="Insert Link"><i class='fa fa-link'></i></a>
<a href="#" data-command='unlink' title="Remove Link"><i class='fa fa-unlink'></i></a>
<a href="#" data-command='insertimage' title="Insert Image"><i class='fa fa-image'></i></a>
<a href="#" data-command='p' title="Paragraph">P</a>
<a href="#" data-command='subscript' title="Subscript"><i class='fa fa-subscript'></i></a>
<a href="#" data-command='superscript' title="Superscript"><i class='fa fa-superscript'></i></a>
</div>
<form action="/text", method="POST">
<div id='editor' , name = "text" , contenteditable >
<h1>A Heading.</h1>
<p>You can drag the text area from the bottom right corner of it.</p>
</div>
<br>
<button type="submit">Click Me!</button>
</form>
<br>
<br>
<br>
<br>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="{{ url_for('static', filename='js/index.js') }}"></script>
</body>
</html>
Can some one help me how to post the value of this editor and save it in MYSQL.
@cpradio