Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    31
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Xhtml validation error

    Well, I'm still fairly new to xhtml and have been doing a good job at correcting errors, but I'm stumped as to why my code keeps failing a recent validation.

    http://validator.w3.org/check?uri=ht...idator%2F1.606

    Here's my code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Webfinity Design-Contact Us | Contact us for our services...</title>
    <meta http-equiv="Content-Language" content="en-us" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
    body
    {
    width: 768px;
    }
    
    #form
    {
    position: relative;
    top: 150px;
    left: 50px;
    width: 300px;
    text-align: left;
    }
    
    .submit li
    {
    position: relative;
    top: 200px;
    left: 70px;
    }
    
    .info
    {
    position: relative;
    top: 100px;
    left: 70px;
    width: 550px;
    background-color:#ACD095;
    text-align: center;
    padding:10px;
    border:solid thin #167A58;
    }
    
    ul
    {
    list-style: none;
    }
    </style>
    <script type="text/javascript">
    function validate_fields(thisform)
    {
    
    if (thisform.company.value == "" || thisform.company.value == null)
     	{
     	alert("Please enter your company's name");
    	return false;
      	}
    if (thisform.phone.value == "" || thisform.phone.value == null)
     	{
     	alert("Please enter your phone number");
    	return false;
      	}
    if (thisform.email.value == "" || thisform.email.value == null)
     	{
     	alert("Please provide an email address");
    	return false;
      	}
    if (thisform.comments.value == "" || thisform.comments.value == null)
     	{
     	alert("Please provide us with some comments");
    	return false;
      	}
    }
    function setstyle(x)
    {
    document.getElementById(x).style.background="#FFCC33";
    }
    function loseStyle(x)
    {
    document.getElementById(x).style.background="white";
    }
    </script>
    </head>
    <body>
    <p class="info">Please fill this form out for us to process your request.<br />
    We only build sites that require more than 3 pages unless you're requesting graphics works.<br />
    If you have any images you want us to use, please feel free to take advantage of our upload funtion on this page.
    </p>
    
    <form name="form" action="contact.php" method="post" onsubmit="return validate_fields(this)" />
    <div id="form">
    <ul>
    <li>Company Name:<br />
    <input type="text" onfocus="setstyle(this.id)" name="company" id="company" onblur="loseStyle(this.id)" /></li>
    <li>Phone #:<br />
    <input type="text" onfocus="setstyle(this.id)" name="phone" id="phone" onblur="loseStyle(this.id)" /></li>
    <li>Email:<br />
    <input type="text" onfocus="setstyle(this.id)" name="email" id="email" onblur="loseStyle(this.id)" /></li>
    <li>Work Type:<br />
    <select name="work">
    <option value="website">Website</option>
    <option value="graphics">Graphics</option>
    </select></li>
    <li>Number of Pages: <br />
    <select name="page">
    <option value="0">0 (Graphics)</option>
    <option value="3">3 ($255 Minimum)</option>
    <option value="4">4 ($340)</option>
    <option value="5">5 ($425)</option>
    <option value="6">6 ($510)</option>
    <option value="7">7+ ($595+)</option>
    </select></li>
    <li>Referral: <br />
    <input type="text" onfocus="setstyle(this.id)" name="referral" id="referral" onblur="loseStyle(this.id)" /></li>
    <li>We allow the following formats: .jpg, .jpeg, .gif, .bmp, .png, .psd, .zip, .rar <br />
    <input type="file" name="upload" value="Browse" /></li>
    <li>Comments: <br />
    Please post any questions or comments you have for us to answer about our services and/or information regarding your website. <br />
    <textarea onfocus="setstyle(this.id)" name="comments" id="comments" onblur="loseStyle(this.id)" rows="5" cols="45"></textarea></li>
    <li><input type="submit" name="submit" value="Submit" />
    &nbsp;
    <input type="reset" name="reset" value="Reset" /></li>
    </ul>
    </div>
    </form>
    </body>
    </html>
    Thanks,
    Andrew
    Last edited by andrewjs18; 11-22-2008 at 05:08 AM.

  • #2
    Regular Coder fishluvr's Avatar
    Join Date
    Nov 2005
    Posts
    110
    Thanks
    1
    Thanked 12 Times in 12 Posts
    One thing that jumped out upon a quick glance:

    Code:
    <form name="form" action="contact.php" method="post" onsubmit="return validate_fields(this)" />
    ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸¸.·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>

  • Users who have thanked fishluvr for this post:

    andrewjs18 (11-21-2008)

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    31
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by fishluvr View Post
    One thing that jumped out upon a quick glance:

    Code:
    <form name="form" action="contact.php" method="post" onsubmit="return validate_fields(this)" />
    Ah, I found it.

    I closed the tag this way:
    /> instead of simply like this:
    >

    Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •