Tim Ottinger wrote:
I'm wondering if anyone has an example of how to create
entry controls for dates, times, ip addresses, etc. I was
half hoping there was an 'entry mask' that could be specified.
It would be cool if we could build one in python, provided that
none actually exist.
I'm also interested in any reasonable ways to fake it.
dd-mmm-yyyyy
hh:mm:sec:xxx
xxx.xxx.xxx.xxx
I don't bring a solution, but something to consider in this context:
An idiom for field validation that I really liked was (is?) used
in the PMW demos. (See http://pmw.sourceforge.net/)
The background colour of incorrectly entered fields was changed (to
pink in this case IIRC). This happened directly on entry, so with
a reqiurement that you needed to have an even number of characters
in the field, it was "blinking" as you typed.
You can obviously discuss whether the indication should appear
as you type or as you leave the field. That probably depends on
the situation, but I found this way of indicating errors very
good. It should probably be combined with a descriptive message
in the status line or as a tool tip.
This is very direct and it's not in your way.
I've seen horrible examples where you have to enter a date interval,
and if the last date was earlier than the first, you'll get a modal
dialog with an error message. You have to change the second (correct)
date to be able to leave that field. You get it...
Sorry that I'm going a bit off topic, but what I wanted to say is:
Perhaps entry-masks are fine, but they are not enough. Either because
the data in the field can't be described like that, or because the
relation between several fields matter.
In general, I find that one should restrict the freedom of the
user as little as possible, but indicate problems ASAP. More or
less like in spell-checking-as-you-type in word processors.
I'm even a bit hesitant to use entry-masks... As long as possible
I think it's better to inform the user of mistakes so that they can
correct then, than to force them to do things in a certain way.
Sometimes it might be good to "correct" entered data automagically.
Returning to word processors, I really hate when Word changes
http://something.com to a blue underlined link, or when it capitalizes
the word after a period, but in a data entry form, I would appreciate
that the program would let me enter a date like 010607 and change it
to 2001-06-07 on field exit.
That allows me to type as quickly as possible, and by changing the
formatting on field exit, I get a verification that the program has
interpreted the data as intended.
/Magnus
路路路
--
Magnus Lyck氓 | 脛lvans v盲g 99 | magnus@thinkware.se | tel: 070-582 80 65
Thinkware AB | 907 50 UME脜 | www.thinkware.se | fax: 070-612 80 65