The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Semantics (5 posts)

  1. Matt Mullenweg
    Posted 12 years ago #

    Thank you very much sharing your experiences, lately people have been so negative on the forums it's easy to forget the silent masses who have little or no trouble with WordPress.
    You're right that that "Search:" should be attached to the form element somehow, and <label> is the correct way to do this. I have added this to my todo list for 1.1. Thanks for pointing that out.

  2. WillM
    Posted 12 years ago #

    Well spotted! I never noticed the lack of proper labelling there before, but it's of course needed to conform to Section 518 guidelines. Something seems screwed up in the code though - I'm guessing you had a link or something in the span? Try again with the widget here. :)

  3. tcervo
    Posted 12 years ago #

    I also added label to the search form while getting the site to validate for 508 compliance:
    <form id="searchform" method="get" action="/index.php">
    <h3><label for="s">Search:</label></h3>
    <input type="text" name="s" id="s" size="15" value="Search..." onfocus="clearDefault(this)" />
    <input type="submit" name="submit" value="search" />

  4. tcervo
    Posted 12 years ago #

    Oops, forgot to mention something: for 508 compliance, you should also have a default value for input fields. That's why I have value="Search..." set. The onfocus="clearDefault(this)" clears the input field when it receives focus (the cursor lands in the field). The clearDefault(this) function is simple, and something I always add to my default.js file:
    // This function clears the default value from a form field
    function clearDefault(el) {
    if (el.defaultValue==el.value) el.value = ""

  5. Anonymous
    Posted 12 years ago #

    Hi again, and thanks for fast replys!
    Willm, thanks, but i'm afraid that was just luck. as I've said I don't know PHP, so i'm just tryiing things out and if it works and validate it's fine for me.
    So to be onest....The span tag is there because if I didn't have it "Search:" didn't show up on the page.. probably something else I don't understand in the CSS i guess, LOL.
    tcervo: Thanks for the help! I have made the change to the search-field right after posting here. But I used "onfocus="this.value='';" in the <input> tag.
    Cheers - Andreas

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.