Porblème formulaire avec cake et materialize

Par arcoss 3x, il y a 9 ans


Bonjour,
Je suis train de finir sur mon site web et j'ai décidé de faire un système de commentaire mais le problème c'est que quand on met un textarea php grafiquement c'est moche avec materilize disign docn j'ai mis un tinymce mais le problème c'est qu'avec tinymce en tant que textarea, mon boutton "commenter ce post" n'envoit plus rien du tout ...
Code :

<script type="text/javascript" src='//cdn.tinymce.com/4/tinymce.min.js'></script> <section class="comments"> <h3>Commentez cet article !</h3> <?= $this->Session->flash(); ?> <?= $this->Form->create('Comment', array( 'inputDefaults' => array( 'div' => array('class' => 'form-group'), 'class' => 'form-control', 'label' => false ), )); ?> <form method="post"> <div class="row"> <div class="input-field col s12 m6"> <?= $this->Form->input('username', array('placeholder' => "Votre nom d'utilisateur")); ?> </div> <div class="input-field col s12 m6"> <?= $this->Form->input('mail', array('placeholder' => 'Votre email')); ?> </div> <div class="input-field col s12"> <?= $this->Form->input('content', array('placeholder' => 'Your comment', 'type' => 'textarea')); ?> </div> <div class="col s12"> <button type="submit" name="submit" class="btn waves-effect"> Commenter ce post </button> </div> </div> </form> <script type="text/javascript"> tinymce.init({ selector: 'textarea', theme: 'modern', menubar : false, width: 750, height: 200, plugins: [ 'advlist autolink link lists charmap hr anchor pagebreak spellchecker', 'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking', 'table contextmenu directionality emoticons template paste textcolor' ], toolbar: 'bold italic underline | link | forecolor emoticons' }); </script> <hr> <h3><?= sprintf(__n('%s commentaire', '%s Commentaires', count($post['Comment'])), count($post['Comment'])); ?></h3> <?php foreach ($post['Comment'] as $k => $comment): ?> <div class="row"> <div class="col md 2"> <img src="http://1.gravatar.com/avatar/<?= md5($comment['mail']); ?>?s=100" width="100%"> </div> <div class="col md 10"> <p><strong><?= h($comment['username']); ?></strong> <?= date("d/m/Y à H:i", strtotime($comment['created'])) ?> </p> <p><?= nl2br(h($comment['content'])); ?></p> </div> </div> <hr> <?php endforeach ?> </section>

Merci

3 réponses

Lartak, il y a 9 ans

Bonsoir.
Pourquoi ouvres-tu deux fois le formulaire ?
La première avec le Helper Form et la deuxième avec une simple balise Html ?

arcoss 3x, il y a 9 ans

c'est une erreur je vais enlever le Helper form

arcoss 3x, il y a 9 ans

Bonjour,
J'ai résolu mon problème c'etait le tinymce qui foutait le brain.