Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Problem when validating
Old 06-29-2009, 07:22 PM Problem when validating
Experienced Talker

Posts: 46
Name: Jethro Williams
Trades: 0
I have some drop-down menus on my website. More or less, I copied the code that I used straight from the 'W3 schools' website, so I thought it would be good code. Turns out it's not. When I tried to validate my pages, I got a load of errors. I've fixed most of these, but using the page http://www.jrosworld.com/blog.html, I still get 9 errors. I've read the explanations but I still can't figure out how to make this valid XHTML 1.1.

All the errors occur within the following code:

Code:
<form action="uri">
    <select id="gowhere" onchange="go()">
    <option value="blog.html" />- Select blog entry -

    <option value="blog.html" />June
    <option value="blog/canada/get_that_***.html" />   23rd: Get that ***
    <option value="blog/canada/due_south.html" />   18th: Due South
    <option value="blog/canada/fatties_and_uglies.html" />   14th: Fatties and uglies
    <option value="blog/canada/on_this_day_1_year_ago_anthology.html" />   12th: On this day, 1 year ago anthology
    <option value="blog/canada/jros_world_take_2.html" />   9th: Jro's World: Take 2
    </select>

    </form>
If anyone could tell me how to make this code valid for XHTML 1.1 I'd be greatful.
__________________

Please login or register to view this content. Registration is FREE
jrosworld.com is offline
Reply With Quote
View Public Profile Visit jrosworld.com's homepage!
 
 
Register now for full access!
Old 06-29-2009, 07:45 PM Re: Problem when validating
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You shouldn't be using XHTML 1.1 anyway, it's not supported by IE at all and barely supported in all other browsers. Drop it back to 1.0 Strict and you'll be fine.

You also need to lose the XML declaration, that will throw IE (except 8) into Quirks Mode with some ugly results.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-30-2009, 01:42 AM Re: Problem when validating
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
Yes I agree drop it down to 1.0. But if you want to figure it out, put your option inside an opening and closing option tag like this:
Code:
<option value="1">Aries</option>
http://xhtml.com/en/xhtml/reference/select/
GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Old 06-30-2009, 09:29 AM Re: Problem when validating
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Agreed. The <option> has a matching closing tag, so what you have with the closing slash and not the proper </option> is incorrect.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-02-2009, 06:11 PM Re: Problem when validating
Experienced Talker

Posts: 46
Name: Jethro Williams
Trades: 0
Awesome. That's fixed all but 2 of the errors.

It still doesn't like:

Code:
<select id="gowhere" onchange="go()">
and I can't see what's wrong with this closing tag:

Code:
</form>
If you can see what's wrong with them that'd be great.

As for switching back to XHTML 1.0, I'm not too sure what you mean by that. I just taught myself HTML, and was never too concerned with "versions" or anything. Would that impact the
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
? Because I've never had any clue what any of that meant. I just put it in the top of all my pages because I knew it had to be there.

Thanks for the help!
__________________

Please login or register to view this content. Registration is FREE
jrosworld.com is offline
Reply With Quote
View Public Profile Visit jrosworld.com's homepage!
 
Old 07-03-2009, 10:29 AM Re: Problem when validating
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Then it's time you learned
http://www.alistapart.com/articles/doctype/


Quote:
<?xml version="1.0" encoding="UTF-8"?>
Having the xml declaration in there will throw IE versions (except 8) into Quirks Mode - and you definitely do NOT want that, the results will be ugly.

Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
The XHTML 1.1 DTD is NOT fully supported by any browser at this time, and it will cause problems, so use XHTML 1.0 Strict instead, which IS fully supported.

Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Many will argue that unless you're going to actually render your code AS XML, then using the XHTML doctype rendered as text is 'wrong'. Since XML didn't evolve as it was thought it would, I think it's rather a moot point.


Quote:

<select id="gowhere" onchange="go()">
The validator doesn't like javascript inside a tag, it will ALWAYS choke on that. The validator will also trip errors or warnings on things downstream in your code based on an error it finds above it. So the </form> erorr may be due to what it doesn't like on that <select> tag.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 07-03-2009 at 10:32 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 12:07 PM Re: Problem when validating
Experienced Talker

Posts: 46
Name: Jethro Williams
Trades: 0
Haha I just noticed your signature quote about IE. So true.

I've read that article that you linked to, and I can see why it would make sense to change the doctype of my webpages. But I have about 3,500 pages on my website. And with the exception of Opera, it displays as I intended in every version of every browser that I've tested it with. So would it be worth the weeks of time that it would take me to change the doctype of every page, even though it displays ok now? Will XHTML 1.1 not be fully supported at sometime in the near future? Or is that me being naive?

Quote:
The validator doesn't like javascript inside a tag, it will ALWAYS choke on that. The validator will also trip errors or warnings on things downstream in your code based on an error it finds above it. So the </form> erorr may be due to what it doesn't like on that <select> tag.
I'm not especially JS savvy. What would be the correct way to display this? Something like:

Code:
<select id="gowhere">
<script type="text/javascript">onchange="go()"</script>
???

Thanks.
__________________

Please login or register to view this content. Registration is FREE
jrosworld.com is offline
Reply With Quote
View Public Profile Visit jrosworld.com's homepage!
 
Reply     « Reply to Problem when validating
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28937 seconds with 12 queries