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 8461901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:00:35+00:00 2026-06-10T14:00:35+00:00

I have a form, I want to : 1- Put a name inside as

  • 0

I have a form, I want to :
1- Put a name inside as default
2- When someone clicks in the form, the default text gets outs and they can write. When they click outside the text that they have written is still there to be send.
3- When someone clicks outside without writing anything the default name comes back

I have tried: onblur=”(this.value=’nom’) But when the user writes and he clicks outside, what he wrote is deleted.

<form>
<input type="text" name="titol" value="nom" onClick="(this.value='')"  " />
</form>

I have the example here:
http://jsbin.com/aposun/1/edit

  • 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-06-10T14:00:36+00:00Added an answer on June 10, 2026 at 2:00 pm

    Modify your input:

    <input type="text" name="titol" value="nom" 
       onfocus="if (this.value=='nom') this.value = '';" 
       onblur="if (this.value=='') this.value = 'nom';"
    />
    

    In HTML5 you could use placeholder instead:

    <input type="text" id="titol" name="titol" placeholder="nom" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file in the form of Name@Phone\n . I put the
Hi i have a form in my application where user can put their details.
I have made a form that asks the user to put in first name
I have a gui form, where multiple text boxes are present. I want to
I have a Zend_Form_Element_Multicheckbox and I want to put some of its elements in
I have form and I want to send values from it with ajax to
i have a form and want to submit it with a script. i'm going
I have a form that I want to be validated before showing it initially.
I have a form which I want to be 'resusable' for a variety of
I have a form that i want to appear at the top of every

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.