0
I have a form that I want to pass via POST, but without giving Reload on the full page, after sending the information, I wish a div of that Reload in its content, I have the following code:
<script>
$(function()
{
$("#issuedButton, #expiredButton, #activeButton, #revokedButton").click(function(){
var dataString = $("#searchByTime").serialize();
$.ajax({
type: "POST",
url: "index",
data: dataString
});
$("#reload").load("index #reload");
return false;
});
});
</script>
The POST is being sent, however, I do not know if Reload is not being done, or is being done without updating the information with data received via POST. Follow the div:
<div id="reload">
<?php var_dump($this->searchbyorganization); ?>
</div>
It is in a var dump only for debug. I use the Zend Framework, so the logic is in another controller class.
I believe you should use the done or a Success from AJAX to get the post result
– N. Dias
Just as you will not make a "Reload" of the div, you must rewrite your content with the return of the ajax post or make a new ajax request after the Success of your post.
– Leandro Angelo