Ajax form submit. form submitted twice
问题 I am working with cakePHP and in my view I have a form which has an ajax submit button. I rendered it using the cake helpers. <form method="post" class="form-class" id="form-id" name="form1" style="display: none"> *[content for the form]* <?php echo $ajax->submit('Ok', array( 'id'=> 'submit1', 'url'=> array('controller'=>'c','action'=>'action1'), 'complete'=> 'jsfunction()' )); echo $form->button('Submit',array('id'=>'cancel','value'=>'Cancel','onClick'=>'clickCancel()')); ?> </form> When I