[jQuery] AjaxForm to $_SERVER["PHP_SELF"] = Dosent Work!
Hello to all!
I'm new here, and I have an question =)
I cant bind an form when i'm posting to self?
I can't get the alert("Thank you for your comment!");
Look This very, very simple script:
http://pastemonkey.org/paste/7
Or Here directly:
<?php
require("include/conexao.php");
/* Testa se o form foi enviado */
if(isset($_POST['submit'])){
} else {
?>
<html>
<head>
<!--PARTE DO AJAX -->
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="script/jquery.form.js"></
script>
<script type="text/javascript">
$(document).ready(function() {
$('#loginform').ajaxForm(function() {
alert("Thank you for your comment!");
});
});
</script>
</head>
<body>
<form method="POST" action="<?php $_SERVER["PHP_SELF"] ?>"
name="loginform" id="loginform" />
Usuário<br />
<input type="text" /><br />
Senha<br />
<input type="password" /><br />
<input type="submit" value="enviar" name="submit" />
</form>
</body>
</html>
<?php } ?>