views:

17

answers:

1

I am having some trouble with ajaxform - it does not see to fire. in the ajaxForm code below, the alert never shows up.

I have added an iframe (my_frame) via a bookmarklet. That shows up fine. I want to do some stuff when the form is submitted. getScript succeeds (the form loaded alert is displayed). But the function never gets triggered. What might I be missing?

jQuery.getScript("http://localhost:81/p/a2b/jquery.form.js", function () {
 alert ("form loaded");

jQuery('my_frame#my_cart').ajaxForm(function() { alert ('yo!'); });
}); 
A: 

Your selector will match an element:

<my_frame id="my_cart">

… which isn't a form or HTML, so can't be submitted, so etc. etc.

David Dorward
thanks for putting me on the right track. The correct syntax for me wasvar output = jQuery('#my_frame').contents().find('#output');
Sid