PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Can I have "enter search term here" appear in search box?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can I have "enter search term here" appear in search box?

    I'm not finding an answer to this in the FAQs or forums...

    I'm wondering if the search box can have some words by default placed in it, such as "enter search term here" - to make it clear what it's use is for if I have a stripped down search box in the corner of every page.

    And, can the words be kind of faded (gray) and disappear when a user clicks in the box to enter their actual search term?

  • #2
    There are some general instructions in the FAQ on our to make your own search form for Zoom.

    It is easy to set a default phrase into a HTML data entry box. This is basic HTML.

    Code:
    <input type="text" name="zoom_query" size="20" value="Enter search term here" />
    To clear the content when clicked with the mouse you need some Javascript at the top of the page. Notice how this script only clears the text if the text in the box is equal to the default text. This avoids clearing text that the user has entered.

    Code:
     
    <script>
    function ClearText (TheField) {
      if (TheField.defaultValue == TheField.value)
         TheField.value = ""
    } 
    </script>
    and some more Javascript in the form.

    Code:
    <input type="text"  name="zoom_query" value="Enter search term here" onFocus="ClearText(this)">
    I'll leave it to you to add color to your text.

    Comment

    Working...
    X