to avoid making mistakes (was TARGET bug..please check)

Jan Schenkel janschenkel at yahoo.com
Tue May 1 04:55:36 EDT 2007


--- Dick Kriesel <dick.kriesel at mail.com> wrote:
> On 4/30/07 11:23 PM, "Richard Gaskin"
> <ambassador at fourthworld.com> wrote:
> 
> > I got on this kick a while back about reducing the
> warnings in my apps,
> > looking for ways to provide guidance to the user
> to avoid making
> > mistakes in the first place.
> > 
> > With regard to validation, this trajectory led me
> to a frontScript that
> > simply prevents non-numeric characters from being
> entered into numeric
> > fields, something like this:
> > 
> > on keyDown k
> >    get the uValidationType of the target
> >    if it is empty then pass keyDown
> >    if it is "number" AND k is in "0123456789" then
> >       pass keyDown
> >    end if
> > end keyDown
> 
> Does that trajectory lead to a switch in the
> frontScript, or to focusIn
> handlers that insert their own frontScripts, or
> what?
> 
> It sounds like a good topic for an article in
> RevJournal.  I think it'd be a
> worthy feature for some Rev Standard Library too
> (unless it's become
> proprietary, of course).
> 
> -- Dick
> 

Hi Dick et al,

Putting this into a frontscript with switches based on
a custom property, is definitely the way to go for
input validation.

The tricky part is making sure the pasteKey and
dragDrop messages are handled to test if the content
will still be correct after pasting/dropping text into
a field.

This is not too hard for numerical data, but it gets
tedious to properly support date and time fields, or
text fields that may only contain plain ASCII
characters of a maximum length in a certain pattern.

Jan Schenkel.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the use-livecode mailing list