I am trying to get this to validate on W3C, but it keeps coming back with five e
ID: 644563 • Letter: I
Question
I am trying to get this to validate on W3C, but it keeps coming back with five errors... They are not major errors at all. This is what they are...
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
I have gone through this code top to bottom and cannot see where this is not validating. A fresh pair of eyes can help. Here is the code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Module 3 JavaScript</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #cc0000;
margin: 0;
padding: 0;
text-align: center;
color: #000000;
}
.twoColFixLtHdr #container {
width: 1000px;
background: #FFFFFF;
margin: 0 auto;
border: 1px solid #000000;
text-align: center;
}
.twoColFixLtHdr #header {
background: #DDDDDD;
padding: 0 0px 0 0px;
}
.twoColFixLtHdr #header h1 {
margin: 0;
padding: 10px 0;
}
.twoColFixLtHdr #sidebar1 {
float: left;
width: 200px; /*element floated/width given*/
background: #ffffff;
padding: 10px 10px 15px 20px;
}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px;
padding: 0 20px;
}
.twoColFixLtHdr #footer {
padding: 0 10px 0 20px;
background:#FFFFFF;
}
.twoColFixLtHdr #footer p {
margin: 0;
padding: 10px 0;
}
.fltrt { /*float element right*/
float: right;
margin-left: 8px;
}
.fltlft { /*float element left*/
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
.style1 {
font-size: xx-small;
color: #666666;
}
</style>
</head>
<body class="twoColFixLtHdr">
<div id="container"><div id="header"><div align="center"><img src="Header" alt="Header Image" width="1000" height="400" /> </div>
<div id="sidebar1">
<h3 align="center">Affiliates</h3>
<h3 align="center"><a href="http://localappbiz.com"><img src="file:///C|/Users/JSA/Desktop/Ubiz.png" alt="BizBiz" width="185" height="72" /></a></h3>
<p align="center"><a href="http://bodyresetcenter.myshaklee.com"><img src="file:///C|/Users/JSA/Desktop/Shaklee-Distributor-Logo.png" alt="Shaklee" width="185" height="85" /></a></p>
<p align="center"><a href="https://www.advocare.com/140333776/"><img src="file:///C|/Users/JSA/Desktop/Advocare-24-Day-Challenge2.jpg" alt="Advocare" width="185" height="188" /></a></p>
<p align="center"><a href="http://poughkeepsiecomputers.com"><img src="file:///C|/Users/JSA/Desktop/mhvcs-header.jpg" alt="MHVCS" width="185" height="85" /></a></p>
<p align="center"> </p>
</div>
<div id="mainContent">
<h1 align="center">Welcome to<br />
Adam DiStefano's Home Page</h1><div id="form"></div>
<form action="http://cdlwebsysdev.esc-atsystems.net//WSD/form-to-email.php" method="post">
<fieldset>
<legend><h2>Please Select</h2></legend>
<label>What Would You Like to Do?</label>
<select id="select">
<option value="none" id="no_form"></option><label>no form</label>
<option value="feedback" id="select_feedback">Leave Feedback</option><label>feedback</label>
<option value="help" id="select_help">Help Request</option><label>help request</label>
</select>
</fieldset>
</form>
<form id="feedbackform" action="http://cdlwebsysdev.esc-atsystems.net//WSD/form-to-email.php" method="post">
<fieldset class="no-border">
<h2>Personal Info</h2>
<label for="name" >Name:</label>
<input id="feedback_name" type="text" name="feedback_name" />
<br />
<br />
<label for="email" >Email:</label>
<input id="feedback_email" type="text" name="feedback_email" value=" "/>
<br />
<br/>
<label for="address" >Address:</label>
<input type = "text" name="address2" />
<br />
<br/>
<label for="city" >City:</label>
<input type="text" name="city2" />
<label for="state" ><br />
<br />
State:</label>
<input type="text" name="state2" />
<label for="zip" > Zip:</label>
<input type="text" name="zip2" />
<br/>
<label><br />
Country:
<select size="1" name="CustCountry" id="custCountry" >
<option selected="selected" >Select Your Country</option>
<option value="United States" >United States</option>
<option value="Canada" >Canada</option>
<option value="Mexico" >Mexico</option>
</select>
</label><hr />
<label><h2>Rate the site 1 - 5 Stars!</h2></label>
<label for="one" >1</label><input class="radio" type="radio" name="rating" value="1" />
<label for="two" >2</label><input class="radio" type="radio" name="rating" value="2" />
<label for="three" >3</label><input class="radio" type="radio" name="rating" value="3" />
<label for="four" >4</label><input class="radio" type="radio" name="rating" value="4" />
<label for="five" >5</label><input class="radio" type="radio" name="rating" value="5" />
<br />
<br />
<label>Comments </label>
<p><textarea id="feedback_comments" name="comment" rows="4" cols="25" ></textarea>
</p>
</fieldset>
<button type="submit">Submit</button><button type="reset">Reset</button>
<input type="hidden" name="ToAddress" value="adamtdistefano@gmail.com" />
<input type="hidden" name="CCAddress" value="todd.wolfe@esc.edu" />
<input type="hidden" name="Subject" value="DiStefano Module Assignment 3 - JavaScript" />
</form>
<form id="helpform" name="help_form" action="http://cdlwebsysdev.esc-atsystems.net//WSD/form-to-email.php" method="post">
<fieldset class="no-border">
<legend><h3>Select Your Preferred Method of Contact</h3></legend>
<label>Phone:</label><input type="checkbox" name="phone_method" value="prefered" />
<label>Email:</label><input type="checkbox" name="email_method" value="prefered" />
</fieldset>
<fieldset class="no-border">
<legend><h3>How Can We Help?</h3></legend>
<textarea name="question" rows="4" cols="30" ></textarea>
</fieldset>
<fieldset>
<legend>Personal Info</legend>
<label>Name:</label><input id="help_name" type="text" name="name"/><br/>
<label>Address:</label><input id="help_address" type="text" name="address"/><br/>
<label>City:</label><input id="help_city" type="text" name="city"/><br/>
<label>State:</label><input id="help_state" type="text" name="state"/><br/>
<label>Zip:</label><input id="help_zip" type="text" name="zip"/><br/>
<label>Country:</label><input id="help_country" type="text" name="country"/><br/>
<label>Email:</label><input id="help_email" type="text" name="FromAddress" value="" placeholder="email@email.com"/><br/>
<label>Phone:</label><input id="help_phone" type="text" value="" placeholder="XXX-XXX-XXXX"/><br/><br/>
<button type="submit">Submit</button><button type="reset">Reset</button>
<input type="hidden" name="ToAddress" value="adamtdistefano@gmail.com" />
<input type="hidden" name="CCAddress" value="todd.wolfe@esc.edu" />
<input type="hidden" name="Subject" value="DiStefano Module Assignment 3 - JavaScript" />
</fieldset>
</form>
</div>
<script type="text/javascript">
document.getElementById("feedbackform").style.display = "none";
document.getElementById("helpform").style.display = "none";
function changeForm() {
var select = document.getElementById("select");
if (select.value == "feedback") {
document.getElementById("feedbackform").style.display = "block";
document.getElementById("helpform").style.display = "none";
} else if (select.value == "help") {
document.getElementById("helpform").style.display = "block";
document.getElementById("feedbackform").style.display = "none";
} else {
document.getElementById("feedbackform").style.display = "none";
document.getElementById("helpform").style.display = "none";
}
}
function validate_feedback() {
var feedback = document.getElementById("feedback_comments");
var name = document.getElementById("feedback_name");
var email = document.getElementById("feedback_email");
var emailformat = /^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/;
var emptyfield = "";
if (feedback.value == "") {
emptyfield += "Please provide comments... ";
feedback.style.borderColor = "blue";
}
if (name.value == "") {
emptyfield += "Enter your name... ";
name.style.borderColor = "blue";
}
if (email.value == "" || !email.value.match(emailformat)) {
emptyfield += "Invalid email... ";
email.style.borderColor = "blue";
}
if (emptyfield != "") {
alert(emptyfield);
return false;
}
return true;
}
function validate_help() {
var name = document.getElementById("help_name");
var email = document.getElementById("help_email");
var phone = document.getElementById("help_phone");
var emailformat = /^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/;
var phoneformat = /d{3}-d{3}-d{4}$/;
var emptyfield = "";
if (name.value == "") {
emptyfield += "Please Enter Your Name ";
name.style.borderColor = "blue";
}
if (!document.help_form.email_checked.checked && !document.help_form.phone_checked.checked) {
emptyfield += "Select Your Method of Contact ";
}
if (document.help_form.email_checked.checked) {
if (email.value == "") {
emptyfield += "Invalid Email Address ";
email.style.borderColor = "blue";
}
if (!email.value.match(emailformat) && email.value != "") {
emptyfield += "Invalid Email Address ";
email.style.borderColor = "blue";
}
}
if (document.help_form.phone_checked.checked) {
if (phone.value == "") {
emptyfield += "Invalid phone ";
phone.style.borderColor = "blue";
}
if (!phone.value.match(phoneformat) && phone.value != "") {
emptyfield += "Invalid Phone Number ";
phone.style.borderColor = "blue";
}
}
if (emptyfield != "") {
alert(emptyfield);
return false;
}
return true;
}
</script>
</body>
</html>
Explanation / Answer
I run this program it works properly it doesn't throw any errors
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.