Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Location
    USA
    Posts
    314
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    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

  • #4
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Mar 2005
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Regular Coder
    Join Date
    Sep 2004
    Location
    USA
    Posts
    314
    Thanks
    7
    Thanked 0 Times in 0 Posts
    1. All form elements must have an action. <form action="something here">

    2. Yup, still need quotes for javascript, onchange="somestuff"

  • #7
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    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.

  • #8
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #9
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Alright, I added a blank action to all of them. That got rid of the action errors.

    Now what about the name?

  • #10
    Regular Coder
    Join Date
    May 2004
    Location
    Berkeley, California Age: 15
    Posts
    398
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #11
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #12
    New to the CF scene
    Join Date
    Jun 2005
    Location
    Vancouver, Canada
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Woah.. I never knew there was a 3rd generation to pokemon.

  • #13
    Regular Coder
    Join Date
    Sep 2004
    Location
    USA
    Posts
    314
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Im confused, what is the name for, are you using that to refer to it in your css?

  • #14
    New Coder
    Join Date
    Jun 2005
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    <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..

  • #15
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •