Call PHP program as popup overlay?
<p>I am trying to use fancybox iframe to call a PHP program for payment processing from a javascript program as part of a landing page. The page also calls another PHP program that writes date to a file. I tried to simulate a click to start the fancybox function but never got it to work. I keep getting this error - $("a.hiddenclicker").fancybox is not a function. I'm not sure whether to attempt to just add this logic to the PHP file or figure out how to get fancybox to work. Here is my page. The call to fancybox is in ProcessForm().</p>

<pre><code>function WriteData(url) {
var j1 = document.getElementById("hiddenclicker"); 

  var Request2 = false;  
  if (window.XMLHttpRequest) {
    Request2 = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    Request2 = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (Request2) {   
    Request2.open("GET", url, true); 
    Request2.onreadystatechange = function() {
      if (Request2.readyState == 4 &amp;&amp; Request2.status == 200) {
              }
    }
    Request2.send(null);


  }
}


  function ProcessForm(form) {
    var j1 = document.getElementById("hiddenclicker"); 
    var firstname = "";
    var lastname = "";
    var payment = "";
    var email = "";
    var phone = "";
    var donation = "";
    firstname = form.firstname.value;
    lastname = form.lastname.value;
    email = form.email.value;
    phone = form.phone.value;
    donation = form.donation.value;
    if (firstname == "") {
        alert("You must fill in the first name");
        form.firstname.focus();
        return false;
                }
    else {
        if (lastname == "") {
            alert("You must fill in last name");
            form.lastname.focus();
            return false;
        }
    else {
        if (email == "") {
            alert("You must fill in email address");
            form.email.focus();
            return false; }
        }
    } 
    WriteData("writedata.php?firstname=" + firstname + "&amp;lastname=" + lastname + "&amp;email=" + email + "&amp;phone=" + phone + "&amp;donation=" + donation);


if (donation == "now") {

jQuery(document).ready(function(){
    $("a.hiddenclicker").fancybox(
    {
        'width' : 600,
        'height' : 400,
        'hideOnContentClick' : false,
        'type' : 'iframe'
    });
     });    
  j1.href = "http://www.ccyakids.org/donation_logic/donation_start.php#form";   
  $('#hiddenclicker').trigger('click'); 
}
</code></pre>

<p>}</p>

<p>// End hiding JavaScript statements -->
</p>

<p>HTML needed to trigger hiddenclicker</p>


     Hidden Clicker
    
