Code displaying incorrect in IE 8

BCMG76

Active Member
Joined
Apr 10, 2010
Messages
45
Reaction score
0
Hi guys please see attachment code, the code displays well with all browsers except with IE 8, if you guys can copy and paste then open it with IE then try opening it again using another browser you will see how it displays what please check and advice.

<!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>Ligwalagwala Funerals</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="js_styles.css" type="text/css" />
<text align="left"/>
<script type="text/javascript">
/* <![CDATA[ */
function checkForNumber(fieldValue) {
var numberCheck = isNaN(fieldValue);
if (numberCheck == true) {
window.alert("Please enter a valid number");
return false;
}
}
/* ]]> */
<!--HIDE FROM INCOMPATIBLE BROWSERS
// STOP HIDING FROM INCOMPATIBLE BROWSERS-->
</script>
</head>
<body>
<h1><b>Order Here</b></h1>
<h2><b>Please select below</b></h2>
<form action="FormProcessor.html" method="get" enctype="application/x-www-form-urlencoded">
<p><strong>Choose what you need us to assist you with:</strong></p>
<p><select name="services">
<option value="funeralcasket">Funeral Casket</option>
<option value=funeralcremation">Funeral Cremation</option>
<option value="funeralarrangement">Funeral Arrangement</option>
<option value=funeralcar">Funeral Car</option>
<option value="funeralcoffin">Funeral Coffin</option>
<option value="funeralcost">Funeral Cost</option>
<option value="funeralflowers">Funeral Flowers</option>
<option value="funeralhomes">Funeral Homes</option>
<option value="funeralinformation">Funeral Information</option>
<option value="funeralmemories">Funeral Memories</option>
<option value="funeralparlor">Funeral Parlor</option>
<option value="funeralplanner">Funeral Planner</option>
<option value="funeralpreplanning">Funeral Pre Planning</option>
<option value="funeralpaymentsplan">Funeral Payments Plan</option>
<option value="funeralprices">Funeral Prices</option>
<option value="funeralprograms">Funeral Programs</option>

</select></P>





<table border="0">
<tr>


<p><b>Complete the form below</b></p>


<p>Name<br />
<input type="text" name="name" size="40" /></p>
<p>Surname<br />
<input type="text" name="surname" size="40" /></p>
<p>Residential Address<br />
<input type="text" name="residential_address" size="60" /></p>
<input type="text" name="name" size="60" /></p>
<input type="text" name="name" size="60" /></p>
<p>Code<input type="text" name="code" size="10" onchange="return checkForNumber(this.value);"/></p>
<p>Contact Number<br />
<input type="text" name="area_code" size="3" maxlength="3" onchange="return checkForNumber(this.value);" />
<input type="text" name="number" size="7" maxlength="7" onchange="return checkForNumber(this.value);" /></P>
<p>Cellphone<br />
<input type="text" name="cellnumber" size="10" maxlength="10" onchange="return checkForNumber(this.value);" /></p>
<p>Email Address<br />
<input type="text" name="email" size="50" /></P>

<p><strong>Where did you here about us?</strong></p>

<p><select name="aboutus">
<option value="newspaper">Newspaper</option>
<option value="internet">Internet</option>
<option value="afriend">A Friend</option>
<option value="brochure">Brochure</option>
<option value="radio">Radio</option>
<option value="flyer">Flyer</option>
</select></P>


</table></tr>




</form>
</body>
</html>
 
You can go research more about why, but removing the

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

sorts the problem out.
 
Thanks Shred i did remove the DTD and it worked,displayed correctly. But why? anyone out there know what's causing this?
 
Sure, remove the odd table code you have wrapping the form (and keep the doctype in):

<table border="0">
<tr>

</table></tr>

Delete those lines. The reason taking the doc type out 'fixes' it, is because IE then enters 'quirks mode' which is a lot more lenient of bad code.
 
Thanks CrazyBob it worked, you're very helpful guys.
 
The reason taking the doc type out 'fixes' it, is because IE then enters 'quirks mode' which is a lot more lenient of bad code.
... which then introduces its own set of issues. Setting the doctype to strict is the first thing you should do when coding for multiple browsers.

Removing the table was the right thing to do, BTW - don't use tables for layout. There is no need (unless you are coding a HTML email, which is another problem entirely ;)).
 
... which then introduces its own set of issues. Setting the doctype to strict is the first thing you should do when coding for multiple browsers.

Removing the table was the right thing to do, BTW - don't use tables for layout. There is no need (unless you are coding a HTML email, which is another problem entirely ;)).

Yup...

/spits on Outlook for not allowing proper CSS and background images
 
/spits on Outlook for not allowing proper CSS and background images

:D Outlook is not the only culprit in this regard. There is no standard whatsoever regarding HTML email support, and far too many email clients. Even GMail is a culprit in this regard, implementing its own set of standards. :wtf:
 
Top
Sign up to the MyBroadband newsletter
X