Hi,
i have a huge problem, validation messages doesnt shown up in my form
when I submit with wrong data. This is my form view:
<div id="stylized" class="myform">
<h1><?php __('Dodaj novo pitanje'); ?></h1>
<p>Osmislite. napišite i postavite</p>
<?php echo $form->create('Question', array('url' => array(
'controller' => 'questions',
'action' => 'add'
),
'class' => 'yform'));?>
<?php
echo $form->input('Question.ime', array('label' =>
'Ime<span class="smallic">Ime ili nadimak</span>' ));
echo $form->input('Question.pitanje', array('label' =>
'Pitanje<span class="smallic">Osmislite konkretno pitanje</
span>' ));
?>
<?php echo $form->end(array('label' => __('Postavi pitanje',
true), 'class' => 'button')); ?>
<div class="spacer"></div>
</div>
and validation is:
var $validate = array(
'ime' => array(
'rule' => 'notEmpty',
'message' => 'Ovo polje ne smije biti prazno.',
),
'opis' => array(
'rule' => 'email',
'message' => 'Molimo unestie ispravnu e-mail adresu.',
),
);
and function in controller is:
function add(){
if (!empty($this->data)) {
if ($this->Question->save($this->data)) {
$this->Session->setFlash(__('Pitanje je spremljeno.',
true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('Pitanje nije spremljeno.
Pokušajte ponovo.', true));
}
}
}
I tried hunderd of combinations but i can't figurate what I'm duing
wrong.
When form are submited I got some strange error, btw. layouts going
crazy :(
form is here http://www.zakogaglasati.com/questions/
please help
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en