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

  • SEARCH
  • Home
  • 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 6730701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:26:24+00:00 2026-05-26T10:26:24+00:00

We have a survey where certain pages have a single textarea question. Since it’s

  • 0

We have a survey where certain pages have a single textarea question. Since it’s the only input, we want to have it focus on that box onload. But we also want to have a placeholder-style text in that same textarea.

There are quite a few solutions to making both functions work on all browsers such as this one by Ajaxblender. But I want the hint to remain after focus, then disappear when text is entered. Any ideas?

Note – I realize the HTML specs state that the placeholder element should going away on focus. So maybe I should say that I want a “watermark”. This UI is for older men with low computer literacy – they need any assistance we can provide them.

Must work with IE8 🙁

  • 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-26T10:26:25+00:00Added an answer on May 26, 2026 at 10:26 am

    If I understand the question, you could try something like

    HTML

    <textarea id="first">Instructions go here</textarea>
    

    jQuery

    $('#first').focus().one('keydown', function(){
        $(this).val('');    
    });
    

    Example: http://jsfiddle.net/jasongennaro/AYRyH/

    Explanation

    1. An empty .focus() puts the focus on the field at onload.
    2. .one() fires an event once for the element
    3. On keydown we remove the current value, which are the instructions we added at the beginning.

    EDIT

    Given your comment

    I need it to function a little more like a standard placeholder
    though, so if you enter something, then delete it so the field is
    blank, it goes back to displaying the original hint.

    You could do this… capture the value and then place it back in the textarea on blur if there is nothing there.

    var a = $('#first').val();
    
    $('#first').focus().one('keydown', function(){
        $(this).val('');    
    });
    
    $('#first').blur(function(){
        if($(this).val() == ''){
           $(this).val(a); 
        }
    })
    

    Example 2: http://jsfiddle.net/jasongennaro/AYRyH/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some survey data that I want to describe by political party and
I have an XML structure that looks like this: <?xml version=1.0?> <survey> <responses>0</responses> <question>
I have essentially a survey that is shown, and people answer questions a lot
I have a table of data with survey results, and I want to do
I want to use Excel to capture survey results. I want to have a
I have a survey that's stored in a large object graph of variable depth,
I have a survey database with one column for each question and one row
I have a small survey, but when i submit it says that the msg
I have a Survey model and each survey has_many questions and each question belongs_to
I have this old survey link that is has been superseded by another link,

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.