burger menu icon
WillMaster

WillMaster > LibraryManaging Website Forms

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Easier Field Information Change

Some things happen so automatically that we tend not to notice.

The address bar of browsers is an example. When you've loaded a web page and then you tap the URL in the address bar, the editable URL is selected. You can type a new URL without having to erase the old one (it's erased automatically when you begin to type). If you do that a lot, you tend to take the convenience for granted.

It's a bit unhandy when you only want to change something in the current URL (requires an extra tap to deselect). Still, it is easier to unselect with a tap than it is to erase all the data before typing a new URL.

This article describes how to do a "select the field when the field is tapped" for your forms.

The feature may be provided for a form field when a user is more likely to want to update the entire field than to only edit parts of it.

It's simple to implement. Add this attribute to the form field tag.

onfocus="select()"

Here is an example. The field is prepopulated with data. Tap it to select the data ready for instant replacement. Or, tap again to unselect and edit.

Try it. You'll see how it works.

Here is the source code for the above example field.

<input type="text" onfocus="select()" value="This is pre-populated text" style="width:100%;">

So much functionality by adding a small copy-and-paste attribute.

(This content first appeared in Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2026 Will Bontrager Software LLC