jQuery Form go through e.preventDefault() to CodeIgniter controller if successful post |
[eluser]thekalaban[/eluser]
Overview I have a form: Code: <?php echo form_open_multipart( 'new_account/validate_new_account', array('id' => 'main-form') ); ?> I submit it to my controller's validate_new_account() function: Code: function validate_new_account() I use the jQuery Form Plugin to interact with the controller. Code: var options = { Problem Without my ajax function, the code above works perfectly but I have dynamically added elements which requires ajax to handle all validations or else these elements will be gone (bad UX). So if I enable and use my ajax function, the validation errors from CodeIgniter are printed out how I want BUT if all validations are now correct, the form does not go to $this->view_preview_form( $this->get_post_data() );. Why is this happening? I've search for similar problems but sadly none helped my weird case. How can I get pass through e.preventDefault() if the form was sent successfully?
[eluser]Otemu[/eluser]
Hi Use this Code: if (data.length === 0) {
|
Welcome Guest, Not a member yet? Register Sign In |