Forum Moderators: open

Message Too Old, No Replies

iFrame with Form

         

naaathan

7:11 pm on Mar 20, 2008 (gmt 0)

10+ Year Member



I have an iFrame on the sidebar of an XHTML template. It includes a form, where users can submit data for a quote. The form either submits successfully and displays a message or submits unsuccessfully and displays a list of errors with a "back" button.

In Firefox and Safari, everything works perfectly. In Internet Explorer 6 & 7, submitting the form gives me a blank page where the iFrame should be.

I was originally using an XHTML Strict DOCTYPE (on the template. The iFrame src document uses a Strict DOCTYPE), but switched to Transitional, then to Frameset. None of these change the problem.

I have images of what this looks like, but I'm not sure that the WW guidelines allow me to post them.

Here's what the code looks like(included in the template):

<iframe src="inc/quickquote-form.php" frameborder="0" width="200" height="350" ></iframe>

The quickquote-form.php simply echo's an XHTML page based on the success or failure of the submission.

Do I appear to be missing anything? What are some iFrame guidelines? Is there a better way to do this?

Thanks ahead.

naaathan

6:29 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



The iFrame src itself is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>QuickQuote Form</title>
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" charset="utf-8">
<script src="../scripts/option-list.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/forms.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<form action="qq-submit.php" method="post" id="quickquote" name="qqForm">
<img src="../images/quickquote.gif" alt="" />
<ul id="quickquote-fields">
[... form elements ...]
<li>
<input type="image" src="../images/submit.gif" id="submit" name="submit" value="Submit" />
</li>
</ul>
</form>
</body>
</html>

The form's action(qq-submit.php) is:

<?
require('lib.php');
if(isset($_POST['submit'])){
$name = clean_data($_POST['name']);
$email = clean_data($_POST['email']);
$phone = clean_data($_POST['phone']);
$machine = clean_data($_POST['qqFormMachines']);
$model = clean_data($_POST['qqFormModels']);
$serial = clean_data($_POST['serial']);

[...check for errors...]

if(!is_array($errors)){
// Create the To, Subject strings, then modify the Email headers

// Template for the message the recipient, $to, will receive

// Send the email

echo "<div id="qqformbox">";
echo "<p>Thanks for submitting a Quick Quote! We will contact you in 1-2 days.</p>";
echo "</div>";

} else {

echo "<div id="qqformbox">";
echo "<img src="../images/quickquote.gif" />";
echo "<p>Please correct the following errors:</p>";
echo "<ul id="qqerrors">";
foreach($errors as $val){
echo "<li>$val</li>";
}
echo "</ul>";
echo "<a href="quickquote-form.php">&larr;Back</a>";
echo "</div>";

}
}
?>

It looks qq-submit.php is still loading after I submit the form, but the page is blank. When I view source, nothing's there. I'm open to doing this a different way, but I've gotten this far on it so far...

naaathan

8:03 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



For some reason, removing the
if(isset($_POST['submit'])){ 
allows it to work. I have no idea why.