input value question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
My question pertains to a contact form where someone would type their
phone number. Example:
<input type="text" name="Phone" size="30" value="(include area code)">

The type of input that I am searching for is when the page is viewed
then words (include area code) would be visible in the form and then
when someone clicks the input box, then the words include area code
would disappear and then they could type their phone number with the
area code.

Thanks in advance,

Re: input value question (hhservices) wrote:

Quoted text here. Click to load it

That's not a good approach, since the value attribute, if present, should
specify a useful initial (default) value for the field.

Quoted text here. Click to load it

You could do that, with the usual caveats, using a simple piece of
JavaScript. But it is better to avoid creating the problem in the first
place. Use something like

<div>Please specify your full phone number, including area code.</div>
<div><label for="phone">Phone:</label>
<input type="text" id="phone" name="Phone" size="30"></div>

Yucca, /
Pages about Web authoring:

Re: input value question (hhservices) wrote in message
Quoted text here. Click to load it

You could probably do something with Javascript, but IMHO, the best
thing to do is to place the instruction under the input box, just like
on a paper form.

Adrienne Boswell
Please respond to the group so others can share

Site Timeline