7 replies [Last post]
hethinksitsreal
Offline
Regular
Last seen: 13 years 33 weeks ago
Joined: 2007-04-05
Posts: 25
Points: 0

I just started trying to validate all my pages with xhtml transitional with the W3C validator. My page uses ColdFusion elements that seem to be giving the validator a lot of problems.

It seems that the validator interprets the code differently, as in, not with cfml tags. Do I need to use a different doctype for validation purposes? My code is only partial coldfusion, so I figured the XHTML transitional validation would work.

Please check out the errors by pasting this: http://www.carolinagreen.net/theinfamy/contact.cfm into the W3C validator http://validator.w3.org.

As you can see if you check the page for validation, I'm also having issues with JavaScript. I have a script that is like 4 lines long that I have to use, and it just won't validate.

Any help would be very much appreciated.

Cameron

Here's my code.

The Infamy | home

SELECT *
FROM entries
WHERE ID = #URL.ID#


























Name:spacer image





Comments:spacer image
#HTMLEditFormat(Comments)#






   View Guestbook











SELECT * FROM MailingList
WHERE EmailAddress = '#FORM.EmailAddress#'





** Already on List **


Thanks, but it looks like you are already on the list. No need to join twice!









** Thank You! **


You have been added to our mailing list. Look for news updates and show information soon!













Name:spacer image




Email Address:






















Tags:
Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 38 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Nearly every error is

Nearly every error is because you've used uppercase for your attributes instead of lowercase. There's also no language attribute for javascript, just use script type="text/javascript".

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

hethinksitsreal
Offline
Regular
Last seen: 13 years 33 weeks ago
Joined: 2007-04-05
Posts: 25
Points: 0

I don't think the validator

I don't think the validator is picking up the newest version of the document. I've reuploaded the file without the language attribute in the javascript section many times and it says it's still there.

It also appears to be interpreting my ColdFusion code as JavaScript. The whole big section you see in the code that the validator shows is NOT written in my page. The code in the page is exaclty what you see above.

I have another problem now...

I use a select box in this (http://www.theinfamyrock.com/store_content.htm) page to allow users to select a shirt size. However, when I try to validate it, the validator tells me that I'm not allowed to have the text in between the <option value="#"/> tags. This text MUST be there in order for the options to appear in the selector on the page. If I take them out, the document validates.

Is there a new XHTML way to do this?

Here's the code:



Size

YM - Youth MediumYL - Youth LargeS - Adult SmallM - Adult MediumL - Adult Large

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 26 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

S - Adult Small

:? <option value="S - Adult Small" />S - Adult Small

try:

<option value="S - Adult Small">S - Adult Small</option>

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

hethinksitsreal
Offline
Regular
Last seen: 13 years 33 weeks ago
Joined: 2007-04-05
Posts: 25
Points: 0

It works!

Thanks! That worked great. Now if I could just figure out why it's saying that I'm using invalid JavaScript when I'm not.

hethinksitsreal
Offline
Regular
Last seen: 13 years 33 weeks ago
Joined: 2007-04-05
Posts: 25
Points: 0

Another validation problem...

URL: http://www.truckerstoystore.net/gallery.cfm

I'm getting errors from the W3C validator about <tr> tags being out of place or left open when they are definitely closed. I've checked over it several times.

I know everyone and their mom says "stay away from tables for formatting unless you're actually using tabular data." In this case, the pictures called from the database by CFML have to be formatted in this way because I want them to be equally spaced, so I'm using CFML that says "if the results are greater than 5, end the <tr> tag, add a row with a single cell containing an 10px spacer image, and start a new row." If I don't do this, the results will be displayed in a single column straight down with nothing to the right of it. That's anywhere from 1 to > 300 75px height thumbnail images, so you can imagine how long my page is without this.

This is why I'm confused, because even if you just look at the code on the page, all of my <tr> and <td> tags are properly opened and closed. Another error says the <tr> tag is not allowed here. However, it works when you view the page and when you search. In other words, my functionality is intact, but I'm doing 2 things that don't please W3C.

Also, if someone can tell me how to do this same thing without the tables, I'm all for it.

Any help on this issue would be appreciated.

Cameron

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

hethinksitsreal wrote: This

hethinksitsreal wrote:

This is why I'm confused, because even if you just look at the code on the page, all of my <tr> and <td> tags are properly opened and closed. Another error says the <tr> tag is not allowed here. However, it works when you view the page and when you search. In other words, my functionality is intact, but I'm doing 2 things that don't please W3C.

Look closely. The validator even gives you the lines to look at.

#156 ... there is a row with no cells.
#200-205 ... there is no closing of the cell or row between form closing and table closing.

Sure you can have equally spaced elements not in a table. For images, put them in a container large enough to hold them and their space. Put margins on the images to space them apart. If necessary assign a class to either the first or last (or both) to cancel the outer margins on those images. For other things, assign a width and float left. Again use margins (or padding) to space them out. Don't use margin-left on float:left or margin-right on float:rights to avoid IE bugs.

hethinksitsreal
Offline
Regular
Last seen: 13 years 33 weeks ago
Joined: 2007-04-05
Posts: 25
Points: 0

Figured it out...

It was a problem with my ColdFusion. I forgot that I had set up conditions for it to skip a large chunk of code if there weren't keywords specified in the search box. I just had to move the end </td> and </tr> tags outside of the <cfif> tags I wrapped the conditional information in.

Thanks for pointing me in the right direction.

Cameron