Please let me know if I'm wrong though. I could very well be. Though, as I said, I did test my code before offering the suggestion.
On 10/18/06,
Klaus Hartl <[EMAIL PROTECTED]> wrote:
> $("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
discuss@jquery.com
http://jquery.com/discuss/
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/