form submit
form submit
hi, a have a php script that doesn't execute or something. I hope you can help.
Now the whole page is reloaded and i don't get the "data loaded" alert. The page should not be reloaded after a submit and i would like to know if I can call a script via jquery
The javascript. Placed in the <head> section. The alert works.
-
$("form#testForm").submit(function()
{
//alert("begin testform ");
$.post("scripts/test.php", function(data){
alert("Data Loaded: " + data);
});
});
The php script. I didn't know if I have to echo or return for seeing the data in the alert of the $.post ()
-
<?php
echo "echo";
return "return";
?>
my HTML form
-
<form id="testForm">
<input type="text" id="test" />
<input type="submit" value="save"/>
</form>