Solved

Remove text on focus change in form?

Posted on 2013-06-24
2
296 Views
Last Modified: 2013-07-09
Form
I want the Keywords and Location text to disappear when a Visitor clicks in the respective field.

What's the conventional approach?
0
Comment
Question by:sandshakimi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39272228
How do you applying this text? if you are using html5 tags and used placeholder then it will be disappear when you click on like:

<input type="text" name="Keywords" id="Keywords" placeholder="Keywords" />

Open in new window

Otherwise you can use a simple javascript to Manage like:
<input type="text"  onblur="if(this.value=='')this.value='Keywords';" onfocus="if(this.value=='Keywords')this.value='';" value="Keywords" id="Keywords" name="Keywords">

Open in new window

0
 

Expert Comment

by:Junshiro
ID: 39283969
you may want to use script that using the
<script ...>
Codes here
</script>

instead of using in-line script :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question