Hi,
How do I prevent my user from submitting an empty form?
When I do that, I'm getting a HTTP 404 not found error in IE and a blank page in Firefox.
None of the validation errors are showing up.
I even tried putting an else stmt in the StudentsController's add function and that too is not firing. Nothing shows up for die(debug($this->Student->validationErrors)) either:
if (!empty($this->data)){
die(debug($this->Student->validationErrors)); $student=$this->Student->saveAll($this->data);
if (!empty($student))
{
$this->Session->setFlash('Your child\'s admission has been received. We will send you an email shortly.');
$this->redirect(array('controller'=>'pages', 'action'=>'home'));
}
else{
$this->Session->setFlash(__('Your admission could not be saved. Please, try again.', true)); }
} //for if (!empty....
thank you.