Why this form won't submit?

Hi guys

I have created a form,
http://coder9.com/jazportfolio/admin/admin2/add_record

And when I press the ‘save’ button it won’t submit/redirect to the path.

I’m thinking maybe the jQuery codes is the culprit?

Can someone give shed to this please.

Thanks in advanced.

Hi,

Shouldn’t you be including the jQuery Form Plugin somewhere in your page?

<script src="http://malsup.github.com/jquery.form.js"></script>

I have already included.
So why it’s not redirecting?

Hi,

Sorry, so you have.

Why are you expecting it to redirect?
The form is submitting, but you aren’t doing anything with the response.

AJAX typically involves sending HTTP requests from client to server and processing the server’s response. This can take place without reloading the entire page (asynchronously).
Javascript receives the data response from the server and can then do something with it (normally update the DOM dynamically).

You can test all of this out if you create a PHP file called test.php and copy this into it.

<?php 
$arr = array("message" => "The server says hello!");
echo json_encode($arr);
?>

Then alter your form to submit to test.php:

<form action="test.php" method="post" enctype="multipart/form-data" id="imageform">

Then do something with the response:

success : function ( json ) {
  alert(json.message);
}

Now when you submit your form, you at least see a response from the server, proving the plugin is doing what it should.

I hope this helps.

@pullo
Thanks dude I’ll try.