• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

Remove text on focus change in form?

Form
I want the Keywords and Location text to disappear when a Visitor clicks in the respective field.

What's the conventional approach?
0
sandshakimi
Asked:
sandshakimi
1 Solution
 
Jagadishwor DulalBraces MediaCommented:
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
 
JunshiroCommented:
you may want to use script that using the
<script ...>
Codes here
</script>

instead of using in-line script :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now