• Resolved linrakesh

    (@linrakesh)


    Dear Friends
    I am trying to develop a wordpress theme according to the wordpress documentation. Upto this stage i am little bit successful. In my theme i am using default search form in my header.php file. When, i tried to validate this theme with validator.w3c.org. It displayed one error on the screen and according to it

    Line 22, Column 15: there is no attribute “role”

    <form role=”search” method=”get” id=”searchform” action=”https://localhost/wo…

    ?

    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.

    I have checked several times spelling and case of the element but unable to locate the problem.

    Kindly guide me

Viewing 5 replies - 1 through 5 (of 5 total)
  • See here for a possible solution.

    Thread Starter linrakesh

    (@linrakesh)

    Thanks for this hack , I would like to say. What is your opinion if i remove this role attribute from the wordpress core file.

    I personally don’t think it’s a big deal to leave that role="search". It may not validate, but there is certainly no harm in leaving it, and you won’t have to worry about messing around with core files every time you do an upgrade.

    Thread Starter linrakesh

    (@linrakesh)

    You are right , Every time i will upgrade my wordpress this problem will arise and i have to modify again and again. so i choose the simple solution searchform.php file as suggested by the link you have just provided me.
    Thank you very much for your kind consideration and quick reply.

    You’re very welcome, glad you have a solution. If you would please mark this thread as “resolved” (drop-down menu in the right column) it would be appreciated. Helps everyone keep better track of whose issues are still outstanding. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search Form and HTML validation ERROR’ is closed to new replies.