Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 249013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:23:27+00:00 2026-05-11T21:23:27+00:00

Basically two parts of the question. How to put explanatory text inside textboxes in

  • 0

Basically two parts of the question.

  1. How to put explanatory text inside textboxes in a form (like writing e-mail in the text area of a text box in a form) with styles (i.e. greyed out so that meant to suggest) like on facebook homepage.
  2. How to put cursor focus on a particular form-field as soon as the page loads (like google sign-in or facebook sign-in)

Is there javascript involved in any of the above procedures? if yes, please specify

  1. a non-javascript workaround and/or
  2. the javascript code doing what is needed
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:23:27+00:00Added an answer on May 11, 2026 at 9:23 pm

    The first trick is just a preset value. And when you click the field it has an onclick function that checks. Is the value “Write your email here”. If so, clear the field. If not do nothing.

    It then has an onblur function that checks, is the field empty. If so, print “Write your email here” in it.

    The 2nd one is JavaScript as well.

    Here is an Example page with both these functions

    <html>
    <script type="text/javascript">
        function searchBox()
        {
            elem = document.getElementById("search");
    
            if(elem.value == "Search...")
            {
                elem.value = "";
            }
        }
    
        function searchBoxBlur()
        {
            elem = document.getElementById("search");
    
            if(elem.value == "")
            {
                elem.value = "Search...";
            }
        }
    
        function init()
        {
            document.getElementById("other_box").focus();
            }
            window.onload = init;
        </script>
    <body>
        <input type="text" name="other_box" id="other_box" />
        <input type="text" name="search" id="search" value="Search..." onclick="searchBox()" onblur="searchBoxBlur()" />
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an app that has two parts. Basically, the first part shows a
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application
Basically you have two ways for doing this: for (int x = 0; x
I basically created some tables to play around with: I have Two main tables,
My dilemma is, basically, how to share an enumeration between two applications. The users
Basically, I would like a brief explanation of how I can access a SQL
This probably sounds like a stupid question, but I'm going to give it a
This is a two part question, but I want to make sure the first
This is sort of a two part question. I'm building a flash image viewer
Basically, I need some parts of database data synchronized on up to several dozens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.