Great! I found the solution by myself. Put the js codes for validation into $option['before'] instead of the form's attribute "onsubmit" can solve my problerm.
Like this: <?php $options = array( 'url'=>'/news/add', 'update' =>'newListBox', 'before'=>'MyprettyValidateFunction();' 'complete'=>$ajax->remoteFunction(array('url'=>'/news/show/latest','update'=>'newsContent')), 'class'=>'btn' ); echo $ajax->submit('Post', $options); ?> if MyprettyValidateFunction() returns false, no submition happends. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---