Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-05-2005, 07:53 AM   PM User | #1
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
Getting a lot of errors when attempting to validate this form

Howdy. I was directed here by a member from another forum who said this is the place to ask more advanced questions, so here goes:

I'm currently working on converting my HTML pages into XHTML - getting a jump start on the 'next big thing' in web design. It's going well except for one minor problem. I have a form that uses listboxes as a navigation method and the W3C Strict XHTML 1.0 validator is spitting out a whopping 405 errors regarding this form.

Could someone take a look at my code and tell me what I'm doing wrong? It'd be greatly appreciated.

The page is:

http://www.elitegurus.com/001.html

Here's the URL to the validator with all the options already inputted:

http://validator.w3.org/check?uri=ht...line&verbose=1

I hope I posted this in the right place - I checked the rules and all the FAQs. If not, could a mod/admin move this for me? Many thanks.
zeroality is offline   Reply With Quote
Old 06-05-2005, 08:18 AM   PM User | #2
Riboflavin
Regular Coder

 
Join Date: Sep 2004
Location: USA
Posts: 312
Thanks: 7
Thanked 0 Times in 0 Posts
Riboflavin is an unknown quantity at this point
Several of your problems are derived from not using quotes.

PHP Code:
<select size=10 
should be
PHP Code:
<select size="10" 
and

PHP Code:
<option value=319.html class="b3"
should be
PHP Code:
<option value="319.html" class="b3"
That should fix litterally a few hundered of the errors, after that post again and I'll take another look.





Edit: I almost forgot, welcome to the forums! This is truely a great place, just you wait and see.

Last edited by Riboflavin; 06-05-2005 at 08:21 AM..
Riboflavin is offline   Reply With Quote
Old 06-05-2005, 09:50 AM   PM User | #3
JamieR
Senior Coder

 
JamieR's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 3,161
Thanks: 0
Thanked 5 Times in 5 Posts
JamieR is on a distinguished road
Quote:
Originally Posted by Riboflavin
Edit: I almost forgot, welcome to the forums! This is truely a great place, just you wait and see.
Yeah, welcome to zeroality. Wooh, people are recommending us, they must like is
__________________
-Jamie
JamieR is offline   Reply With Quote
Old 06-05-2005, 08:50 PM   PM User | #4
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
Woohoo, down to 13 errors! Yeah, I can see that this is a great place. ^_^

Alright, go re-validate it and see what those 13 errors are about, if you could?

Many thanks.
zeroality is offline   Reply With Quote
Old 06-05-2005, 09:06 PM   PM User | #5
trancedm
Regular Coder

 
Join Date: Mar 2005
Posts: 123
Thanks: 0
Thanked 0 Times in 0 Posts
trancedm is an unknown quantity at this point
if you dont need the form name then just remove it otherwise use id
ex.
<form name="nav">

still missing some quotes
ex.
<select size="10" onchange=document.location.href=document.nav.Gen1.options[docu
trancedm is offline   Reply With Quote
Old 06-05-2005, 09:11 PM   PM User | #6
Riboflavin
Regular Coder

 
Join Date: Sep 2004
Location: USA
Posts: 312
Thanks: 7
Thanked 0 Times in 0 Posts
Riboflavin is an unknown quantity at this point
1. All form elements must have an action. <form action="something here">

2. Yup, still need quotes for javascript, onchange="somestuff"
Riboflavin is offline   Reply With Quote
Old 06-05-2005, 09:19 PM   PM User | #7
rmedek
Senior Coder

 
Join Date: Nov 2003
Location: Minneapolis, MN
Posts: 2,879
Thanks: 2
Thanked 65 Times in 56 Posts
rmedek is on a distinguished road
Quote:
Originally Posted by zeroality
I'm currently working on converting my HTML pages into XHTML - getting a jump start on the 'next big thing' in web design.
Just to let you know, XHTML isn't the "next big thing" in web design as much as standards is. So I would put less stress into converting your site to XHTML (which is still being served as HTML anyway) and more into moving the site away from a nested table layout... essentially structuring your page a little more semantically.

But you're taking all the right steps, though... validation is a great place to start.
__________________
drums | web
rmedek is offline   Reply With Quote
Old 06-05-2005, 09:47 PM   PM User | #8
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
Alright, down to 4 errors. Yes - the forms need to have a name, that's how the javascript works.

See the form name is "nav2" and the script is like: onchange="document.location.href=document.nav2.Gen2.options[document.nav2.Gen2.selectedIndex].value"

So how do I make it stop giving errors?

As for adding actions, what should I add? I don't think that's it. The validator is just complaining about the 'name' parameter.

To rmedek - I read somewhere that HTML was becoming outdated so I decided to just switch to XHTML.

As for using tables - yeah, I've already been lectured on that. The problem is, I have 400 pages already laid out in tables and converting it to div would be a major pain.

I like tables anyway - hey, at least I'm not using FRAMES anymore! LOL. I had a whole site made with inline frames.
zeroality is offline   Reply With Quote
Old 06-05-2005, 10:03 PM   PM User | #9
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
Alright, I added a blank action to all of them. That got rid of the action errors.

Now what about the name?
zeroality is offline   Reply With Quote
Old 06-05-2005, 10:32 PM   PM User | #10
Jalenack
Regular Coder

 
Join Date: May 2004
Location: Berkeley, California Age: 15
Posts: 398
Thanks: 0
Thanked 0 Times in 0 Posts
Jalenack is an unknown quantity at this point
just delete the name. It doesn't do anything....
__________________
Jalenack.com .:. YWDA Founder .:. Rounded Corners Maker 1.1! .:. My Blog
The hardest thing about teaching is not knowing the right answers, but knowing the right questions - Elisabeth Klein
Pretty buttons does not a great website make.
Jalenack is offline   Reply With Quote
Old 06-05-2005, 10:37 PM   PM User | #11
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
That removes the functionality.

So yes, it does do something.

I've tried

<form="nav" action="">

<form id="nav" action="">

<form action="">

They validate fine but the form loses functionality. The only thing that seems to work so far is:

<form name="nav" action="">

I might have to live with the 3 errors but would like to get it fixed.
zeroality is offline   Reply With Quote
Old 06-06-2005, 12:20 AM   PM User | #12
MTsoul
New to the CF scene

 
Join Date: Jun 2005
Location: Vancouver, Canada
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
MTsoul is an unknown quantity at this point
Woah.. I never knew there was a 3rd generation to pokemon.
MTsoul is offline   Reply With Quote
Old 06-06-2005, 12:24 AM   PM User | #13
Riboflavin
Regular Coder

 
Join Date: Sep 2004
Location: USA
Posts: 312
Thanks: 7
Thanked 0 Times in 0 Posts
Riboflavin is an unknown quantity at this point
Im confused, what is the name for, are you using that to refer to it in your css?
Riboflavin is offline   Reply With Quote
Old 06-06-2005, 12:40 AM   PM User | #14
zeroality
New Coder

 
Join Date: Jun 2005
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
zeroality is an unknown quantity at this point
<form name="nav" action="">

<select size="10" onchange="document.location.href=document.nav.Gen1.options[document.nav.Gen1.selectedIndex].value" name="Gen1">

See the document.nav.Gen1 ? Without the name, it doesn't know which form the code is referring to since I have 3 of them.

<form name="nav2" action="">

<select size="10" onchange="document.location.href=document.nav2.Gen2.options[document.nav2.Gen2.selectedIndex].value" name="Gen2">

And so forth..
zeroality is offline   Reply With Quote
Old 06-06-2005, 12:52 AM   PM User | #15
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
this might work, haven't tested but its a good possibility. Try
Code:
<form name="nav" action="">

<select size="10" onchange="document.location.href=this.form.Gen1.options[document.nav.Gen1.selectedIndex].value" name="Gen1">
You might be better off using the bracket notation. Glenng has some good documentation about this. For the first form. You can start with 0 then the forms after that go in subsequent order, so your nav2 would be document.forms[1].Gen2. etc.
Code:
<form name="nav" action="">

<select size="10" onchange="document.location.href=document.forms[0].Gen1.options[document.nav.Gen1.selectedIndex].value" name="Gen1">
You could lose the name for both instances.
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:12 AM.


Advertisement
Log in to turn off these ads.