Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Won't This HTML Code Validate?

 
Kaydell Leavitt
Ranch Hand
Posts: 690
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: 690
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: 34974
379
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