SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Keeps Failing Validation

    Can someone help me please. I cannot seem to be able to validate this code to XHTML Transitional 1.0.

    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>JavaScript Web Development Quiz</title>
    
    <link rel="stylesheet" href="qzstyle.css" type="text/css" /> 
    
    <script type="text/javascript" src="quizconfig.js"></script>
    
    </head> 
    
    <body>
    <h1>Instant Quiz Results</h1>
    
    <form method="post" name="result" action="">
    <div class="results">
    Number of questions you got right:
    </div>
    <div class="results">
    <input type="text" name="p" size="24" />
    </div>
    
    <div class="results">
    The questions you got wrong:
    </div>
    <div class="results">
    <textarea name="T2" rows="3" cols="24" ></textarea>
    </div>
    
    <div class="results">
    Grade in percentage:
    </div>
    <div class="results">
    <input type="text" name="q" size="8" />
    </div>
    
    </form>
    
    <form method="post" action="">
    <script type="text/css">
    var wrong=0
    for (e=0;e<=2;e++)
    document.result[e].value=""
    
    var results=document.cookie.split(";")
    for (n=0;n<=results.length-1;n++){
    if (results[n].charAt(1)=='q')
    parse=n
    
    }
    
    var incorrect=results[parse].split("=")
    incorrect=incorrect[1].split("/")
    if (incorrect[incorrect.length-1]=='b')
    incorrect=""
    document.result[0].value=totalquestions-incorrect.length+" out of "+totalquestions
    document.result[2].value=(totalquestions-incorrect.length)/totalquestions*100+"%"
    for (temp=0;temp<incorrect.length;temp++)
    document.result[1].value+=incorrect[temp]+", "
    </script>
    
    <input type="button" value="Take the quiz again" name="B1" onclick="history.go(-1)" />
    <input type="button" value="View solution" name="B2" onclick="showsolution()" />
    </form>
    
    </body>
    </html>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    valid

    <script type="text/css"> ???
    And the validator likes code inside comments ie.
    <script ...
    <!--
    this + that;
    // -->
    </script>

  3. #3
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you that was very helpful, I copied and pasted the wrong type by mistake!


Bookmarks

Posting Permissions

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