> $("form#photo-upload-form")
> .submit(function() {alert("inside");})
> .submit();
That won't work. You have to get out the DOM node out of the jQuery
object first before calling submit() on it:
$("#photo-upload-form")
.submit(function() {alert("inside");})
[0].submit();
^^^
You have to be always careful with such code. Once the element
#photo-upload-form is not found for whatever reason an error will be
thrown, because yor are calling a function on undefined.
Speaking of optimizing queries, leave away the element type "form" in
front of your id selector as well.
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/