Hey Guys,
I'm trying to load a form in a jQuery UI Dialog box using the follow jQuery code. The problem is the form loads, and you can fill it out, but it seems that on form submission, the page will reload and the data was never submitted.
jQuery(document).ready(function($) {
$('#submit-photo').each(function() {
var $link = $(this);
var $dialog = $('<div></div>')
.load($link.attr('href'))
.dialog({
autoOpen: false,
title: $link.attr('title'),
width: 500,
height: 300
});
$link.click(function() {
$dialog.dialog('open');
return false;
});
});
});
Which is called using this link:
<a id="submit-photo" href="<?php bloginfo('url'); ?>/parkpage/hotham/submit-photo" title="Submit Your Mt Hotham Park Photo"><img src="<?php bloginfo('template_directory'); ?>/images/parkpage/camera.png" alt="Upload Photo" width="45" height="50" longdesc="Upload your own photo." /></a>
The above links to a page "submit-photo", that contains the form.
You can see it in action by going to the following page. Click on the little camera half way down the page to see the form load in a dialog box.
http://dev.popmag.com.au/blog/parkpage/hotham
I'm not sure if it's even possible to use a gravity form in a jQuery UI Dialog box, but it would be awesome if it is possible! Thanks.