By the way, I also have a beforeFilter in my StudentsController:
function beforeFilter()//executed before any controller action logic
{
//parent::beforeFilter();
if(isset($this->Security) && $this->RequestHandler->isAjax() &&
$this->action = 'getcities'){
$this->Security->enabled = false;
}
}
but i don't think that is causing any prob coz' i already tried
testing my webiste by commenting the beforeFilter.
On Aug 4, 3:49 pm, varai <[email protected]> wrote:
> 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:
>
> [CODE]if (!empty($this->data)){
> [COLOR="red"]die(debug($this->Student->validationErrors)); [/COLOR]
> $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{
> [COLOR="Red"]$this->Session->setFlash(__('Your admission could
> not be saved. Please, try again.', true));[/COLOR]
> }
> } //for if (!empty....
> [/CODE]
>
> thank you.
>
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php