Solved

Remove text on focus change in form?

Posted on 2013-06-24
2
288 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
Comment Utility
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
Comment Utility
you may want to use script that using the
<script ...>
Codes here
</script>

instead of using in-line script :)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now