1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Missing form label

Discussion in 'HTML & Website Design' started by Soupi, May 3, 2018.

  1. #1
    I have this piece of code and it is flagging missing form label, how do i fix it?

    <select size="1" name="sort">
    <xsl:choose>
    <xsl:when test="$smode='showBag'">
    <xsl:choose>
    <xsl:when test="$sort = ''">
    <option value="title" selected="selected">title</option>
    <option value="creator">author</option>
    <option value="year">publication date</option>
    <option value="reverse-year">reverse date</option>
    </xsl:when></select>


    2nd I have these two errors Multiple form labels
    The code is
    <form id="formResultPage">
    <input type="hidden" id="inputResultPageTotalPages" value="{$totalPages}" aria-labelledby="inputResultPageTotalPages"/>
    <input type="hidden" id="inputResultPageMaxDocs" value="{$maxDocs}" aria-labelledby="inputResultPageMaxDocs"/>
    <label class="hidden" for="inputResultPage">Input for Results Page</label>
    <input type="text" id="inputResultPage" class="input-text input-sm" value="{$currentPage}" />
    </form>

    SEMrush
     
    Soupi, May 3, 2018 IP
    SEMrush
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,607
    Likes Received:
    1,543
    Best Answers:
    224
    Trophy Points:
    515
    #2
    "Flagging" by WHAT? What tool is telling you this?

    Though in terms of mistakes the first one is simple, where's your LABEL tag for that select? Selects need a LABEL just like INPUT and TEXTAREA do, you have none.

    The second one is filled with gibberish nonsense. Where's your fieldset? Prior to HTML 5 inline-level tags like INPUT could not be direct children of a FORM, and it's still semantic gibberish today that can have rendering issues. another of HTML 5's idiotic dumbass changes. You have no NAME on your hidden input, there is likely zero reason for them to even have ID, and those stupid dumbass aria role garbage serve ZERO legitimate purpose on a hidden input. The pointless classes likely aren't helping matters much either... Laundry list of how NOT to use HTML..

    But I suspect a lot of that is some form of scripttardery pissing all over accessibility by building forms that don't even work when JavaScript is disabled -- an instand WCAG violation and failure to grasp how to use HTML properly.
     
    deathshadow, May 12, 2018 IP