PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.html > Advice re debugging techniques
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Advice re debugging techniques

Réponse
 
LinkBack Outils de la discussion
Vieux 18/04/2008, 04h16   #1
rhino
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Advice re debugging techniques

I am getting an HTML error on my page that I'm having trouble tracking down.

I'd like to emphasize that I am _not_ asking someone to tell me exactly what
is wrong with my specific HTML in this case. I'm trying to determine a good
technique for finding my own problem through skillful debugging techniques.
I should mention that I've been programming in a variety of programming
languages for many years; HTML is not even close to being the first thing
I've tried to debug.

My doctype is set to HTML 4.01 Strict and I am getting two messages; it's
the first one that really bothers me. I strongly expect that the second
message will go away as soon as I fix the problem identified by the first
message:

================================================== ==============================

Line 109, Column 60: document type does not allow element "SELECT" here;
missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
"ADDRESS" start-tag .

<select name="Style" size="1" onChange="Change_Style(this);">

The mentioned element is not allowed to appear in the context in which
you've placed it; the other mentioned elements are the only ones that are
both allowed there and can contain the element mentioned. This might mean
that you need a containing element, or possibly that you've forgotten to
close a previous element.

One possible cause for this message is that you have attempted to put a
block-level element (such as "<p>" or "<table>") inside an inline element
(such as "<a>", "<span>", or "<font>").


Line 117, Column 6: end tag for "FORM" which is not finished .
</form>Most likely, you nested tags and closed them in the wrong order. For
example <p><em>...</p> is not acceptable, as <em> must be closed before <p>.
Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child
element that you did not include. Hence the parent element is "not
finished", not complete. For instance, in HTML the <head> element must
contain a <title> child element, lists (ul, ol, dl) require list items (li,
or dt, dd), and so on.

================================================== ===============================

The messages are referring to a very simple form that is situated on my
page. Here's the code:

================================================== ================
108. <form action="*" enctype="text/plain" name="StyleChoices">
109. <select name="Style" size="1" onChange="Change_Style(this);">
110. <option value="0">Original</option>
111. <option value="1">Green on White</option>
112. <option value="2">Yellow on Magenta</option>
113. <option value="3">Green on Blue</option>
114. <option value="4">Blue on Salmon</option>
115. <option value="5">Black on Grey/Patterned</option>
116. </select>
117. </form>
================================================== ================

I am confident that there is nothing wrong any part of the form itself. It
appears that the problem lies in the context. My strong suspicion is that
the form is part of some other markup that probably isn't composed quite
right or that is missing a closing tag.

Can anyone suggest techniques that will me track down what is wrong
elsewhere on the page?

I am using a recent version of HTML-Kit and have IE6, IE7 and the latest
versions of Firefox and Opera. As an "old school" type, I could find this
problem by carefully commenting out various bits until I find the problem
but, in the interest of time, I'd rather not devote multiple hours to this
problem. I have to believe that there are plugins for the browser and/or
HTML-Kit that will me find this problem faster.

Can anyone tell me which plugins I should be using to track down this
problem?

I'd be grateful for your !

--
Rhino



  Réponse avec citation
Vieux 18/04/2008, 05h10   #2
rf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Advice re debugging techniques

"rhino" <No.offline.contact.please@anonymous.com> wrote in
news:fu93od$rdu$1@news.datemas.de:

> I am


multiposting.

Don't. See your answer over at alt.www.webmaster.


--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org
  Réponse avec citation
Vieux 18/04/2008, 17h57   #3
Michael Stemper
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Advice re debugging techniques

In article <fu93od$rdu$1@news.datemas.de>, rhino writes:
>I am getting an HTML error on my page that I'm having trouble tracking down.
>
>I'd like to emphasize that I am _not_ asking someone to tell me exactly what
>is wrong with my specific HTML in this case. I'm trying to determine a good
>technique for finding my own problem through skillful debugging techniques.


Well, the most useful technique is to go to the W3C validator and then
fix all of the errors that it lists. For instance:

>Line 109, Column 60: document type does not allow element "SELECT" here;
>missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
>"ADDRESS" start-tag .


What this means is that you can't put a select where you put it; it has
to be in a paragraph or div or something.

>The mentioned element is not allowed to appear in the context in which
>you've placed it; the other mentioned elements are the only ones that are
>both allowed there and can contain the element mentioned.


The above text tells you exactly what you need to know. You can't put
a select element directly into a form; it needs to be enclosed in a
block-level element.

>One possible cause for this message is that you have attempted to put a
>block-level element (such as "<p>" or "<table>") inside an inline element
>(such as "<a>", "<span>", or "<font>").


Or, in this case, that you have attempted to put a select element into
a form without enclosing it in something.

Fix this problem first, and then see if the next one goes away.

> Line 117, Column 6: end tag for "FORM" which is not finished .
></form>Most likely, you nested tags and closed them in the wrong order. For
>example <p><em>...</p> is not acceptable, as <em> must be closed before <p>.
>Acceptable nesting is: <p><em>...</em></p>


>The messages are referring to a very simple form that is situated on my
>page. Here's the code:
>
>================================================= =================
>108. <form action="*" enctype="text/plain" name="StyleChoices">
>109. <select name="Style" size="1" onChange="Change_Style(this);">
>110. <option value="0">Original</option>
>111. <option value="1">Green on White</option>
>112. <option value="2">Yellow on Magenta</option>
>113. <option value="3">Green on Blue</option>
>114. <option value="4">Blue on Salmon</option>
>115. <option value="5">Black on Grey/Patterned</option>
>116. </select>
>117. </form>
>================================================= =================
>
>I am confident that there is nothing wrong any part of the form itself.


Why are you confident of this, when the validator, not only told you
that there was something wrong with the form, but told you WHAT WAS
WRONG WITH IT?

>Can anyone suggest techniques that will me track down what is wrong
>elsewhere on the page?


Fix the error that the validator reported, then revalidate and fix the
next error that it reports. Try believing what the validator tells you.

--
Michael F. Stemper
#include <Standard_Disclaimer>
If this is our corporate opinion, you will be billed for it.



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h58.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15312 seconds with 11 queries