Staying on a field

Pete pete at mollysrevenge.com
Wed May 4 14:58:42 EDT 2011


The whole area of data validation is pretty interesting, lots of different
ways to indicate errors.

There seem to be at least two different types of validation: the integrity
of each field and cross field relationships.

You can sometimes do the former with keystroke captures (numeric only for
example), sometimes I find it better to wait until the user tabs out of the
field (e.g. for dates).  If all the data on a form is valid under those
criteria, then you have to check cross field dependencies, e.g. if you have
a start date and an end date, they might both be valid dates but the end
date can't be before the start date.

I try to eliminate as much as possible of the field integrity checking by
using dropdown/combobox menus showing only valid values, or, for a date, a
calendar stack for selecting the date.

For checks that are done after a field loses focus, I usually change the
colour of the text of the label associated with the field.

The whole thing about having a Save button is interesting too.  I always use
a Save button when I'm adding new data but for changing existing data, I
like to just go ahead and change it on a control by control basis in the
appropriate handler (closeField, menuPick, etc), assuming it's valid of
course.  That's my personal preference and I'm sure others might hate having
to work that way!

I'm betting that there are HIG guidelines for this stuff somewhere and that
I'm probably breaking most of them!

Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Wed, May 4, 2011 at 10:58 AM, Bill Vlahos <bvlahos at mac.com> wrote:

> Chris,
>
> Interesting idea. I hadn't thought of it before.
>
> Bill Vlahos
> _________________
> InfoWallet (http://www.infowallet.com) is about keeping your important
> life information with you, accessible, and secure.
>
> On May 4, 2011, at 7:52 AM, Nonsanity wrote:
>
> > Just a comment on user interfaces, have you thought about using the
> common
> > technique of coloring a field's background red if it doesn't contain a
> valid
> > string? Move the test function into a handler that triggers on each key
> > press. This way the right/wrong state of the field is visible to the user
> at
> > all times. You can also disable buttons like Submit or Next Card or
> whatnot
> > if the user shouldn't be able to click them with any fields still red.
> >
> > This interface style minimizes clicks and modal dialogs, while giving the
> > user much more information.
> >
> > Just a thought. :)
> >
> > ~ Chris Innanen
> > ~ Nonsanity
> >
> >
> > On Wed, May 4, 2011 at 12:14 AM, Bill Vlahos <bvlahos at mac.com> wrote:
> >
> >> I do a validity check on a field to see if the user entered a valid
> date.
> >> If the user entered a valid date and presses TAB or RETURN the focus
> moves
> >> on to the next field. However, if the user enters an invalid date I want
> to
> >> keep the focus on the field to try again.
> >>
> >> This field script does everything correctly except that it doesn't set
> the
> >> focus back on the field. What am I doing wrong?
> >>
> >> on closeField
> >>  if me is not a date then
> >>     answer error "Not a valid date. Retry?" with "No" or "Yes"
> >>     if it is "Yes" then
> >>        focus on me
> >>        exit closeField
> >>     end if
> >>  end if
> >>  pass closeField
> >> end closeField
> >>
> >> Bill Vlahos
> >> _________________
> >> InfoWallet (http://www.infowallet.com) is about keeping your important
> >> life information with you, accessible, and secure.
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



More information about the use-livecode mailing list