views:

305

answers:

1

Hi,

Is there a way to stop cakephp ajax submit to stop the submission in case the user has not entered required details and click the submit button.

Regards

A: 

I use the $ajax->submit 'create' options, calling user javascript function foo(). Inside the foo() function I have Event.stop('submitButtonId'); where submitButtonId is the submit button id.

The Event.stop() stops the event from bubbling up, and thus prevented the ajax submission.

porto alet