jQuery.Form wont submit
- by kim
Im´trying to submit a form without refreshing the page, but I´m having a problem.
When I click submit the page refreshes and anothing gets posted.
Here is the code, what am I doing wrong? (I´m a newbie)
jQuery 1.4.2 and the jQuery Form Plugin 2.43 is present.
tnx
$(document).ready(function() {
var options = {
target: '#output2',
url: https://graph.facebook.com/<%=fbUid%>/feed,
type: post,
clearForm: true // clear all form fields after successful submit
//dataType: null // 'xml', 'script', or 'json' (expected server response type)
//resetForm: true // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000
};
// bind to the form's submit event
$('#fbPostStatus').submit(function() {
// inside event callbacks 'this' is the DOM element so we first
// wrap it in a jQuery object and then invoke ajaxSubmit
$(this).ajaxSubmit(options);
// !!! Important !!!
// always return false to prevent standard browser submit and page navigation
return false;
});
});