This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Won't This HTML Code Validate?

 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to validate the following code and I get an error for line 57 saying that the <script> tag doesn't belong here, yet the code seems to run OK. What's wrong? Why won't it validate?


 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a nit pick


should be a label



It is more accessible this way.

Now, what are you using to validate this?

Eric>
 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, what are you using to validate this?


validator.w3.org
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like that script should be in an onload function (or jquery or the like equivalent) rather than in the main body of the page between HTML form elements. That way it still runs after the select box is rendered, but is more logically separate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic