Constraining user input...

Greg Saylor GSaylor at ATP.com
Thu Feb 28 00:33:01 EST 2002


Sarah,

Thank you so much for the quick response....  This actually works quite well
and is a great example, thank you!....  I do have one more question though,
this is more out of curiosity I suppose...  Is there some way to store the
"constraint" information as part of the field definition and make this a
function which gets called?.. THe reason I ask is because I have to do this
with about 150 different fields and it would get rather tedious to be
cutting and pasting for each one of them.....

Again, thank you very much for your help -- I really *REALLY* appreciate
it....

Greg Saylor
Senior Systems Integrator

>I don't know that this is a very elegant solution, but it works so it can
>get you started. Put this in the script of your text entry field.
>
>on keyDown theKey
>  if the number of lines in me >= 3 and \
>      the number of chars in line 3 of me >= 30 then
>    beep
>    exit keyDown
>  else
>    put word 2 of the selectedLine of me into theLine
>    if the number of chars in line theLine of me >= 30 then
>      beep
>      exit keyDown
>    end if
>  else
>    pass keyDown
>  end if
>end keyDown
>
>Cheers,
>Sarah
>
>
>> Hello, 
>> 
>> I am completely new to Revolution, but am very interested in using it for
>> on-going projects....  My single biggest need though is to be able to
>> constrain the user input to a set number of characters and lines... For
>> example, for a textbox entry they should only be able to enter 30
characters
>> of text per line and only 3 lines.....
>> 
>> Is this possible with Revolution?.. If you could provide an example I
sure
>> would appreciate it.....
>> 
>> Thanks! 
>> 
>> Greg Saylor 
>> Senior Systems Integrator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20020228/28327ead/attachment.html>


More information about the use-livecode mailing list