Forum Moderators: open

Message Too Old, No Replies

Validation help

I'm so confused by this stuff...

         

shanebryant

6:12 am on Jul 18, 2005 (gmt 0)

10+ Year Member



Hi all, I had someone point out to me just how badly my site validates and so I sent all day today getting rid of as many of the errors as I could, but there are so many left and I have no idea how to fix them.

A lot of them are with table tags and stuff like that that I jus need to figure out, but lots have to do with META stuff, doc type and all that, and problems with the < p > tag (which I can't understand how that could be a problem)...

I don't know, I was just hoping for some help :)

Thanks in advance!

shanebryant

6:42 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



Alright! So I have it down to 27 errors from 400! And it only took me a thousand hours or more ;)

Okay, so now I'm left with a bunch of ALT and IMG errors which I have to search out and fix, but the ones I need help with are these:

Line 529, column 11: ID "search" already defined
<input id="search" name="search" class="text" />

Line 527, column 24: ID "search" first defined here
<form name="search" id="search" method="get" action="http://www.example.com/c

Line 562, column 163: end tag for "input" omitted, but OMITTAG NO was specified
...den" name="flavor" value="subscribe"><input type="text" name="email" value="y

Line 562, column 110: start tag was here
...cgi-bin/dada/mail.cgi" method="post"><input type="hidden" name="flavor" value

Line 562, column 227: end tag for "input" omitted, but OMITTAG NO was specified
...ail" value="your email" class="text"><input type="hidden" name="list" value="

Line 562, column 163: start tag was here
...den" name="flavor" value="subscribe"><input type="text" name="email" value="y

Line 562, column 276: end tag for "input" omitted, but OMITTAG NO was specified
..."hidden" name="list" value="c12list"><input type="submit" value="Join" class=

Line 562, column 227: start tag was here
...ail" value="your email" class="text"><input type="hidden" name="list" value="

Line 562, column 326: end tag for "input" omitted, but OMITTAG NO was specified
...submit" value="Join" class="buttons">

Line 562, column 276: start tag was here
..."hidden" name="list" value="c12list"><input type="submit" value="Join" class=

Line 656, column 106: start tag was here
...lves/archives/000714.shtml#comments"><img src="http://www.example.com/c12s

Line 658, column 106: start tag was here
...n.com/twelves/archives/000714.shtml"><img src="http://www.example.com/c12s

Any help with these?

[edited by: jatar_k at 7:46 pm (utc) on July 21, 2005]
[edit reason] examplified urls [/edit]

g1smd

7:00 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Change & to be &amp; in the text.

An ID must be unique per page. If the ID is for CSS purposes, you'll need to have two different IDs or else change the ID to class and alter the CSS file accordingly.

Add alt="" to every <img> tag.

The <img .... > tags should be <img .... /> instead. The error message even tells you that the closing is missing.

The <input .... > tags should be <input .... /> instead. The error message even tells you that the closing is missing.

These errors are causing "cascading error messages" throughout the rest of your document.

The list needs to be inside a <div> not inside a <span>.

g1smd

7:29 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



All of your errors are the same errors that I see in every request for help.

g1smd

8:17 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The there is no attribute "alt" error applies to several lines, but the validator will only ever report the first one.

The alt attribute is used with <img> tags. You have tried to use it with the <a href=..> tag.

In this case, and only this case, change alt to be title instead. There is a title attribute to use with <a> links, and this is the very time that it should be used.

.

Get all your scripts out into external files.

See if you can find ways to make your source code easier to read, by changing spacing etc.

.

I like to make pages out of headings, paragraphs, lists, tables, and forms. Analyse your content and see if that breakdown works for any of your content.

In one place you have:

<center>
... then a load of links ...
</center>

I would replace that with:

<p align="center">
.... then the links ....
</p>

instead.

shanebryant

8:54 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



Sorry about that, I guess I've just been staring at this code for too long! But hey, 421 errors down to 2 is pretty darn good, at least I think so! :)

So thank you for your last post, I'll hammer that stuff out in a sec, after I get these last 2 errors fixed, and finish up with the left-over positioning problems.

As for the last 2 errors, here's the problem code:

<form name="search" id="search" method="get" action="http://www.example.com/cgi-bin/mt/mt-search.cgi">
<input type="hidden" name="IncludeBlogs" value="2" />
<input id="search" name="search" class="text" />
<input type="submit" value="Go" class="buttons" />
</form>

Giving these 2 errors:


[b]Line 529, column 11: ID "search" already defined[/b]

<input id="search" name="search" class="text" />

[b]Line 527, column 24: ID "search" first defined here[/b]

<form name="search" id="search" method="get" action="http://www.example.com/c

I know nothing of forms, so do I just take out the name=search?

[edited by: encyclo at 8:57 pm (utc) on July 21, 2005]

g1smd

9:12 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



An ID must be unique per page.

You need to find out what the ID is used for. If the ID matches up with stuff in the CSS then you could just duplicate the CSS code with a new ID and change the ID in the HTML to match.

If the ID isn't used for anything, then just change it to something else: search1 and search2 perhaps. FrontPage automatically adds an ID to every form, whether you need one or not.

It has nothing to do with the name attribute, it is the ID attribute that you need to look at. The clues are always in the error message itself.

shanebryant

9:35 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



This is what is in the CSS:

form#search {
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}

#search .text {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
width: 56px;
}

#search .buttons {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
background-color: #FFFFFF;
color: #333333;
}

g1smd

10:24 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I hate hacking someone elses CSS when the dependancies aren't always known.

Try this for a start. Keep a backup of the original HTML snippet and the CSS snippet in a separate text file for the moment.

Change:

<input id="search" name="search" class="text" />

to be:

<input id="notused" name="search" class="text" />

I can't see it making any problems, but then again there is the "law of unintended consequences" to contend with.

.

That bit of CSS is very inefficient; personally I would delete these two lines in all three entries:

font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;

then add a new entry ABOVE those three:

#search {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}

since that style rule is common to all entries, isn't it?

g1smd

11:06 am on Jul 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



OK. Once the code is valid, there are a few things you can do to optimise and unbloat it.

shanebryant

3:09 pm on Jul 22, 2005 (gmt 0)

10+ Year Member



Yeah! It feels so good when it telle you that the page is valid :)

As for the code and optimization, I agree, so where should I begin?

g1smd

5:20 pm on Jul 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Take out most of the blank lines for a start. Keep a blank line before each <div> tag, and before any major blocks of code.
I'll take a look at the site later; haven't got the link where I am right now.

You do know you have to check the code on all of your other pages too? If the navigation was done through server includes then it is already fixed; if not...

This 41 message thread spans 2 pages: 41