WordPress.org

Ready to get started?Download WordPress

Forums

Semantics (5 posts)

  1. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Andreas,
    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
    Member
    Posted 10 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
    Member
    Posted 10 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>
    <div>
    <input type="text" name="s" id="s" size="15" value="Search..." onfocus="clearDefault(this)" />
    <input type="submit" name="submit" value="search" />
    </div>
    </form>

  4. tcervo
    Member
    Posted 10 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 = ""
    }
    -Tony

  5. Anonymous
    Unregistered
    Posted 10 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

Tags

No tags yet.