ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Remove text from search box when you click

October 12, 2011 1:49pm

Subscribe [3]
  • #1 / Oct 12, 2011 1:49pm

    JamesBrighton

    146 posts

    On the search box for the EE forums, when you click on the input the text ‘Search Forum’ is automatically removed.
    http://ellislab.com/forums/

    How is this done? When I turn off javascript it still works, but I thought this feature needed js? Is this functionality standard html or some special EE feature?
    Thanks

  • #2 / Oct 12, 2011 7:54pm

    Kyle Cotter

    730 posts

    Hey James,

    Going to move this to community support, since this isn’t a technical EE issue.

    The answer is, it’s in fact an HTML 5 feature. On the input tag, there is an attribute called “placeholder”, where you can define placeholder text similar to the “Search Forum” here on the EE web site.

    Nothing fancy in EE, just good ol’ HTML 😉

    Hope that helps you in what you’re trying to do.

    Thanks.

  • #3 / Oct 14, 2011 2:05am

    jules6120

    15 posts

    You add a placeholder attribute in your input tag…

    <input type=“text” placeholder=“Type something here” />

    This works on Firefox, Safari, Opera, Chrome… but not IE

  • #4 / May 08, 2012 11:36pm

    mindepic

    1 posts

    There are actually a couple js plugins out there that allow the use of the placeholder attribute back to the IE’s too. Nice feature to have.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases