Browse files

Merge pull request #223 from joelwurtz/patch-2

Fix html5 bug when textarea is required
  • Loading branch information...
2 parents deabf36 + 6dfc22f commit f786c30894cd605fcd3022ec26a7535e4899003b @bamarni bamarni committed Jan 17, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 Resources/views/Form/jquery_layout.html.twig
View
8 Resources/views/Form/jquery_layout.html.twig
@@ -60,7 +60,13 @@
{%- if configs.script_url is defined %}
- $('#{{ id }}').tinymce($configs);
+ var $textarea = jQuery('#{{ id }}');
+ if($textarea.is('[required]')) {
+ $configs.oninit = function(editor) {
+ editor.onChange.add(function(ed, l) { ed.save(); });
+ };
+ }
+ $textarea.tinymce($configs);
{% else %}
tinyMCE.init($configs);

0 comments on commit f786c30

Please sign in to comment.