title: How do I launch Colorbox for AJAX form submission in Drupal 7?
body: <p>I'm submitting a form using a call to this JavaScript function:</p>
  
  <pre><code>function emailFriend(){
    jQuery("form[name='comparisons']").attr("action", "/emailfriend/compare");
    jQuery("form[name='comparisons']").bind('submit', function() {
      jQuery.get(jQuery("form[name='comparisons']").attr("action"),
      jQuery("form[name='comparisons']").serialize(),
      function(data){                // send to colorbox
        $.colorbox({                 // this is where the error comes from
          html:   data,
          open:   true,
          iframe: true               // use iframe
        });
      },
      "html");
    });
    jQuery("form[name='comparisons']").submit();
  }
  </code></pre>
  
  <p>This form opens another form located at /emailfriend/compare. The second form is the one that I am trying to popup in colorbox. The above code works to open the form, but it returns an error <code>$.colorbox is not a function</code> and then opens the target form in the same window/tab.</p>
  
  <p>I am using Drupal 7 with the colorbox module installed and enabled. The colorbox aspect works throughout the site when using it for links, images, etc.</p>
  
  <p>Can anyone tell me what I'm doing wrong?</p>