Results 1 to 4 of 4

Thread: validate styleswitch

  1. #1
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default validate styleswitch

    1) Script Title: styleswitch

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...etswitcher.htm

    3) Describe problem:

    how would i validate styleswiitch?
    this is the error output below
    thankyou for your time
    alto
    ---------------------------------------
    Validation Output: 2 Errors

    1. Error Line 328, Column 21: required attribute "action" not specified.

    <form id="switchform">

    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
    2. Error Line 329, Column 47: there is no attribute "onChange".

    …me="switchcontrol" size="1" onChange="chooseStyle(this.options[this.selectedI


    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <form action="" id="switchform">
    and
    Code:
    onchange="chooseStyle(
    I would strongly advise against using XHTML, however. IE does not yet support XHTML and cannot display pages served as such. A lot of web designers have this terrible habit of writing XHTML and then serving it as HTML (with a text/html content-type). This, however, isn't HTML (yes, even if the validator says it is). What it is is invalid HTML, as bad as if your document didn't validate at all. Instead, I suggest you stick to HTML 4.01 Strict until IE gains XHTML support, or possibly drop support for IE and configure your server to send your XHTML as XHTML (with the application/xhtml+xml MIME type). Unfortunately, however, this often isn't an option on production sites.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    I would strongly advise against using XHTML, however. IE does not yet support XHTML and cannot display pages served as such. A lot of web designers have this terrible habit of writing XHTML and then serving it as HTML (with a text/html content-type). This, however, isn't HTML (yes, even if the validator says it is). What it is is invalid HTML, as bad as if your document didn't validate at all. Instead, I suggest you stick to HTML 4.01 Strict until IE gains XHTML support, or possibly drop support for IE and configure your server to send your XHTML as XHTML (with the application/xhtml+xml MIME type). Unfortunately, however, this often isn't an option on production sites.
    Then why does the W3C site use it?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I presume they suppose the future cost of converting their site to XHTML to be greater than the current cost of having an essentially invalid site.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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