jquery form submission not working
i'm using jquery-1.10.1 and my HTML code is:
<li>
<a href='' id='logout'>Log Out</a></li>
<form id='logout_form' method='post'>
<input type='hidden' name='logout' value='true' />
</form>
my jquery code is this which is at the end of every document:
<script type="text/javascript">
$(function() {
$("#logout").click(function(){
$("#logout_form").submit();
});
});
</script>
and my php code is this:
if(!empty($_POST['logout'])){
$object=new logout();
$content='5;url='.$path.'index.php';
}
but my form submission is not working. anybody pls help me.
No comments:
Post a Comment