cannot submit form data from source code mode, need to enable WYSIWYG mode
See original GitHub issueProbably I am find bug… Summernote cannot submit form data from ‘source code’ mode, need to enable WYSIWYG mode for submit form
Example screencast http://screencast.com/t/YZF1AKrBQ
Sample script (modified example file codemirror.html from 0.7.0 release)
<?php
$data = (!$_POST['summernote']) ? '<b>test</b> sample TEXT' : $_POST['summernote'];
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>summernote - codemirror</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" />
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.css" />
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/blackboard.min.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.min.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.min.js"></script>
<link rel="stylesheet" href="../dist/summernote.css">
<script type="text/javascript" src="../dist/summernote.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.summernote').summernote({
height: 200,
tabsize: 2,
codemirror: {
theme: 'monokai'
}
});
});
</script>
</head>
<body>
<pre>
<?= $data ?>
</pre>
<form method="post">
<textarea class="summernote" name="summernote"><?= $data ?></textarea>
<input type="submit" value="Send" />
</form>
</body>
</html>
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Summernote wysiwyg editor save in codeview not working ...
Try to do something like this. $(document).on("submit","#my-form-name",function(e){ $("#desc").val($('#desc').code()); return true; ...
Read more >Changes to a block's text field not saved when ckeditor ...
Problem /Motivation On a layout builder page I am seeing data loss when saving an existing block with source mode enabled in ckeditor....
Read more >Form Troubleshooting and FAQ
I gave my web developer my form's HTML iframe code, but it's not looking right. ... Any time you set a form to...
Read more >WYSIWYG Editor
If users need to add server-side or client-side code, they should do so by creating a source code asset or inserting it directly...
Read more >TinyMCE not working: possible causes and fixes
In the event of “tinymce is not defined” or the always fun “Uncaught Reference Error” messages, it usually means that the execution order...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alligator77 Thanks for reporting. You can switch mode with external API.
Hi @lqez ,
Why did you close this issue? It was not solved at all. A few workarounds were suggested but the issue is still there and easily reproducible. A workaround != solution.