What I'm trying to accomplish seems rather simple yet I do not have a strong understanding of PHP to execute it. I have a simple form with yes or no radio buttons. I'm wanting to launch a modal window upon form submission and display all of the questions that were answered yes. I'm able to launch the modal window just fine using an iframe, since I plan on having other content besides the form submission inside the modal, yet the VERY simple php script I'm using is not showing up inside the modal. Works just fine when I remove the fancybox script and keep the form action php file the same.
I'm assuming there's a conflict between the jquery and php script firing at different times but have no idea where to begin on how to fix this. Below is the code I am working with. Any help would be great and please keep in mind that I do not know how to code php.
You can see a working example on http://staging.drugrehabtest.com
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" href="scripts/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript">
if(!jQuery.browser.mobile){
jQuery(document).ready(function() {
$(".fancybox").fancybox({
'width' : 920,
'minHeight' : 230,
'type' : 'iframe',
'padding': 20,
'href': 'success.php',
});
});
}
</script>
<form action="success.php" method="post" name="contact" id="contact">
<input type="radio" class="checkbox" name="one" value="yes" title="Do you find yourself using drugs even when you don't want to?: Yes" />
<label class="question">Do you find yourself using drugs even when you don't want to?</label>
<input type="submit" name="Submit" id="submit" class="fancybox fancybox.iframe" />
</form>
Success.php Page (minus other standard html elements)
<?php
if ($_POST['one']=="yes") { echo "Do you find yourself using drugs even when you don't want to?"; }
?>