Solved

Remove text on focus change in form?

Posted on 2013-06-24
2
295 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

726 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