Connecting Tech Pros Worldwide Forums | Help | Site Map

Can I use "on click" event to cause all characters in field to beselected?

Bob Alston
Guest
 
Posts: n/a
#1: Nov 13 '05
I am trying to highlight required data fields in a continuous form
situation. Got it working for all but date fields. For date fields, I
am trying setting default date to -1 (=12/29/1899) and then using this
format: mm/dd/yyyy [Black];" Missing Date"[Red]

Shows words "missing Date" for the default value.

And if a good date is entered, the field displays with black text.

What I want to do is make it easy to fix missing dates. Now, If i click
on the field and start entering, the old date remains. This makes it
hard to enter a new date. You must either tab to the field or manually
select all characters in 12/29/1899 before you start entering a valid
date. What I would like to do is achieve the same as tabbing to the
field but when the user single mouse clicks on the field. So If I can
cause the entire field to be highlighted, when the user types the new
date, the old one is automatically erased.

Suggestions?

Bob

Bob Alston
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Can I use "on click" event to cause all characters in field to beselected?


Bob Alston wrote:[color=blue]
> I am trying to highlight required data fields in a continuous form
> situation. Got it working for all but date fields. For date fields, I
> am trying setting default date to -1 (=12/29/1899) and then using this
> format: mm/dd/yyyy [Black];" Missing Date"[Red]
>
> Shows words "missing Date" for the default value.
>
> And if a good date is entered, the field displays with black text.
>
> What I want to do is make it easy to fix missing dates. Now, If i click
> on the field and start entering, the old date remains. This makes it
> hard to enter a new date. You must either tab to the field or manually
> select all characters in 12/29/1899 before you start entering a valid
> date. What I would like to do is achieve the same as tabbing to the
> field but when the user single mouse clicks on the field. So If I can
> cause the entire field to be highlighted, when the user types the new
> date, the old one is automatically erased.
>
> Suggestions?
>
> Bob[/color]
Found the answer. See this link:
http://groups.google.com/groups?hl=e...eb2d8cc&rnum=2

But I found it didn't work on the "got focus" event but did on the "on
click" event.
Closed Thread