How to get TinyMCE form validation working
- jarjar
- Member | 4
Hi,
I tried to get TinyMCE form validation working following https://pla.nette.org/…installation.
Editor works fine but validation does not. I have no idea
what's wrong/missing. Could someone please help?
layout.latte:
<!-- TinyMCE-->
<script src=“//cdn.tinymce.com/4/tinymce.min.js”></script>
<script>tinyMCE.init({
mode: “specific_textareas”,
editor_selector: “mceEditor”,
});</script>
PostPresenter.php:
protected function createComponentPostForm()
{
$form = new Form;
$form->addText(‘title’, ‘Title:’)
->setRequired();
$form->addTextArea(‘content’, ‘Content:’)
->setAttribute(‘class’, ‘mceEditor’)
->setRequired();
$form->addSubmit(‘send’, ‘Save and publish’);
$form->getElementPrototype()->onsubmit(‘tinyMCE.triggerSave()’);
$form->onSuccess[] = array($this, ‘postFormSucceeded’);
return $form;
}