• ke vinritt

    (@ke-vinritt)


    I’m getting this validation error:
    Line 48, Column 24: Attribute “role” is not a valid attribute. Did you mean “frameborder” or “scrolling”?

    • <form role=”search” method=”get” id=”searchform” action=”https://xadd
      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).
    • Not sure how to fix it or where this file is – I don’t want to mess with things unless I know it’s the right page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Mark Ratledge

    (@songdogtech)

    That’s in your search bar code, which is called in sidebar.php. Try form="search" instead of form role="search", but the validation error isn’t serious enough to affect page display.

    Thread Starter ke vinritt

    (@ke-vinritt)

    I have a function `<?php get_search_form(); ?>’
    but no form. Where would that be?

    esmi

    (@esmi)

    If your theme has a searchform.php template file, edit that file and remove role="search". If it doesn’t have such a file, then the form is being pulled from the WordPress core. Either way, it’s not a major issue. I did flag this up as a minor issue on Trac but was told that the “accessibility benefits outweighed validation” so it wouldn’t be fixed (which is a load of b******s but that’s another story).

    The only other option is to grab the form markup from the source of one of your pages, drop it into a file called searchform.php in your theme and remove the annoying role="search". WP will then use that file instead of the default, invalid, form.

    Either way, don’t let it bother you. If that’s the only kind of validation error you have, you’re doing really well.

    Thread Starter ke vinritt

    (@ke-vinritt)

    The only problem I have is that I cannot put the validated icon on the page. Seems like a minor thing but I’d like to be able to validate. I’ll try your suggestion
    Thank you

    Moderator t-p

    (@t-p)

    Hi esmi,

    I am a new user. Just installed WP and testing it. I get the same validation error.

    If your theme has a searchform.php template file, edit that file and remove role=”search”. If it doesn’t have such a file, then the form is being pulled from the WordPress core. Either way, it’s not a major issue.

    I am using the default theme, and it does not have this “searchform.php” template file. You said “If it doesn’t have such a file, then the form is being pulled from the WordPress core”.

    Question: What does it mean “then the form is being pulled from the WordPress core”?

    Thank you in advance.

    -tara

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘validation error’ is closed to new replies.