How to prevent an empty form submission into CakePHP 2.5.2 -
i new cakephp, how can use javascript prevent form being submitted empty, mean fields empty ? the user hit submit button i using cakephp 2.5.2 you don't need javascript such minor blank validation stuff. go through validation section. check out example below: model: user.php has following validation code email field. class user extends appmodel { public $validate = array( 'email' => array( 'required' => true, 'allowempty' => false, 'message' => 'email cannot empty.' ) ); setting required true, , allowempty false job you. also, "message" field acts icing on cake indicates error message shown when validation fails. peace! xd