Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#21984 closed defect (bug) (invalid)

Adding a placeholder to searchform.php breaks form submission.

Reported by: mwilliam Owned by:
Priority: normal Milestone:
Component: General Version: 3.4.2
Severity: normal Keywords:
Cc: Focuses:

Description

Without a placeholder attibute, the form submits successfully ("?s=[search-term]"):

    <form role="search" method="get" id="searchform" action="<?php bloginfo('url');?>/">
        <div>
            <label class="screen-reader-text" for="s">Search for:</label>
            <input type="text" value="" name="s" id="s">
            <input type="submit" id="searchsubmit" value="Search">
        </div>
    </form>

With a placeholder attibute, however, the form submits blank ("?s=") regardless of the presence of the value attribute:

    <form role="search" method="get" id="searchform" action="<?php bloginfo('url');?>/">
        <div>
            <label class="screen-reader-text" for="s">Search for:</label>
            <input type="text" value="" placeholder="Search" name="s" id="s">
            <input type="submit" id="searchsubmit" value="Search">
        </div>
    </form>

This is a bug on all modern browsers (legacy is excluded because the placeholder attribute is not supported).

Change History (4)

#1 @nacin
14 years ago

Not sure I see how this is a WordPress bug?

#2 @mwilliam
14 years ago

Last edited 14 years ago by mwilliam (previous) (diff)

#3 @mwilliam
14 years ago

  • Resolution → invalid
  • Status new → closed

#4 @helenyhou
14 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.