Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit wont work after zend, ajax / jquery validation
    text
    copied!<p>The follow problem I have, I made for a form a ajax/jquery validation. The validation works fine after the submit, when something is wrong during the validation, I get the errorMessage. But, the problem is. When something is 'OK' it wont submit the input.</p> <p>My js code;</p> <pre><code> ValidateAjax = { initialize: function(formid, endpoint){ end_url = endpoint; form_id = '#'+formid; $('form').submit(function(){ var formElementID = $(form_id+' input').attr('id'); $('.loader').hide(); var check = ValidateAjax.doValidate(formElementID); return false; }) }, doValidate: function(id){ $('.loader').show(); var url = end_url; var data = $(form_id).serialize(); $.post(url,data,function(response){ $('#'+id).parent().find('.errors').remove(); if (response[id]) $('#'+id).parent().append(ValidateAjax.getHTML(response[id])); },'json'); }, getHTML: function(errArray){ $('.loader').hide(); var o = '&lt;ul class="errors"&gt;'; $.each(errArray,function(key,value){ o+='&lt;li&gt;'+ value+'&lt;/li&gt;'; }); o+='&lt;/ul&gt;'; return o; } </code></pre> <p>}</p> <p>My index view;</p> <pre><code>&lt;? echo $this-&gt;form; ?&gt; </code></pre> <p>My validation action;</p> <pre><code>public function validateformAction() { $this-&gt;_helper-&gt;layout()-&gt;disableLayout(); $form = new Application_Form_Add(); $form-&gt;isValidPartial($_POST); $this-&gt;_helper-&gt;json($form-&gt;getMessages()); } </code></pre> <p>My index action;</p> <pre><code>public function indexAction() { $form = new Application_Form_Add(); $this-&gt;view-&gt;form = $form; // submit new blog - Validated by ajax if ($this-&gt;_request-&gt;isPost()) { if ($form-&gt;isValid($_POST)) { $data = $form-&gt;getValues(); //do something $this-&gt;_redirect('/wall/'); } } } </code></pre> <p>I hope someone can help me.</p> <p>With kind regards, Nick</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload