0
I have this code, the animation happens but the redirect to the next page (work.php
) nay.
I mean, you’re not getting into the condition if (isset($_POST...
. If I comment on the piece of code responsible for animation the redirect already happens, but that’s not what I intend:
index php.:
if (isset($_POST['submit'])) {
$firstName = htmlentities($_POST['name']);
$firstName = str_replace(array('.', ',', ';', '?', '/', '|', '(', ')', 'º', '+', '#', '$', '@', "'", '"'), '' , $firstName);
$firstName = trim(ucwords($firstName));
if(!empty($firstName)) {
$user->saveCookie($firstName);
}
header('Location: work.php');
}
require_once('includes/head.php');
?>
<body onunload="">
<div id="wrapper">
.....
<form action="" method="POST">
<input name="name" type="text" autocomplete="off">
<input type="submit" name="submit">
</form>
.....
</html>
js.js:
$('input[type="submit"]').click(function(event) {
event.preventDefault();
$('#footer').css({
"position":"absolute",
"bottom": "5px"
});
$('#wrapper').animate({
"margin-top": "-1000px"
}, 700, function(){
$('form').submit();
});
});
@Kazzkiq, "redirect" is pt_EN ;)
– brasofilo
Yes, but I happen to be :P
– Miguel
@brasofilo My bad, I did a quick search and all the results in Portuguese I saw did not have the second "c", probably because they were from Brazil, so I edited the word.
– Kazzkiq
No problem :)
– Miguel
@Kazzkiq, no problem, I also "fixed" Sergio just to end up realizing that it is necessary to take this care not to abrasify the Portuguese of others.
– brasofilo