Form plugin - ajaxSubmit and ajaxForm on button elements
Hi,
Newbie question -- I'm trying to bind the click on <button id="save">Save</button> element to ajaxSubmit or ajaxForm instead of the standard <input type="submit"...>. But this code doesn't seem invoke showRequest function:
var options = {
target: '#output1',
beforeSubmit: showRequest,
success: showResponse,
dataType: 'json',
error: function(xhr, error){
console.debug(xhr); console.debug(error);
}
};
$(
'#save'
).click(
function
() {
$("#myForm").ajaxSubmit(options);
return false;
});
Please let me know what I might be doing wrong. Thanks for the help!