[jQuery] form.submit not function error jquery form plugin
I'm trying to get an upload popup working with the jQuery form plugin
http://jquery.malsup.com/form/
.
When I click a link I load a form html from the server and add it to a
container div by setting the div's html attribute. I then attach a
submit handler to the form so I can call the ajaxSubmit function of
the form plugin.
$
'#'
popup.popupId
' form'
.submit
function
event
{
event.preventDefault
;
var options = {
dataType : popup.dataType,
success : function
data, textStatus
{
popup.successHandler
popup, data, textStatus
;
}
};
$
'#'
popup.popupId
' form'
.ajaxSubmit
options
;
}
;
The ajaxSubmit function however throws a "form.submit is not a
function" error. I've tried debugging in firebug and form is an
object so I don't understand why the error.
Thanks for your help