I need to have a form display in an overlay and am using the Colorbox jquery code for the overlay. I have a link on a page with the rel="lightbox" and have tried linking to both a .php file and a .html file with no luck. The colorbox code works great on all other links where I'm just displaying some straight HTML. The problem is that I need to use PHP to call the gravity form.
What happens is that when I have the link call the .php file, I get the error message:
Fatal error: Call to undefined function gravity_form() in [followed by my filename and line number]
Although it shouldn't be necessary, since they're already in the header.php file, I added to the .php file the calls to the various jquery and gravity forms scripts and stylesheets but still get that error message.
When I link to the .html version, it displays nothing because it won't run the PHP from within an HTML file. When I add the line to my .htaccess file to run PHP in HTML, like so:
AddType application/x-httpd-php .html
then it wants to download the html file, not display it.....aaarrgh!
I'm calling the colorbox script in my header.php like so:
$(document).ready(function(){
$(".lightbox").colorbox({iframe:false, width:"875px", height:"85%"});
});
What am I doing wrong? I'd rather use the colorbox overlay than simply pop up a new window to avoid problems with popup blockers or people accidentally clicking on another window and sending the form to the background.....I'm sure there must be something simple that I'm overlooking. Or is there an easier way?