Ades Design Blog

How to auto-clear the form field when user clicks

Some very useful things in web design and web-usability are the ones which are extremely easy to implement, for example to implement this auto-clear feature in your form it just takes you to insert only a line of code. Example

So this is the code you should be inserting to every field that you want to auto-clear when the user clicks or when the field is onfocus state:

onfocus=”this.value=””

Here is how it will look like inside your form code:

<form>

<input type=”text” onfocus=”this.value=”” value=”Your Name”>

</form>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>