Submiting a form from ajax outside the page (php)
- by peter
hey i use jquery to insert a form into a div, the form is in a php file.
function show(id){
var content = $("#layer1_content");
$("#layer1").show();
var targetUrl = "mouse.php?cat="+id;
content.load(targetUrl);
}
so everything works, but when i submit it goes too that php page, if i call the same form within the same php then it works fine. the response is handled by:
$('#layer1_form').ajaxForm({
target: '#content',
success: function()
{
$("#layer1").hide();
}
});