Not passing a return key or enter key.

Glen Bojsza gbojsza at gmail.com
Sat Aug 13 09:23:38 EDT 2005


Dave,

I hadn't though about the ability of a user pasting more than 3 lines
- good point.

I am looking at the difference between RawKeyDown and returnInField
and enterInField.

thanks for the ideas

On 8/12/05, Dave Cragg <dcragg at lacscentre.co.uk> wrote:
> 
> On 12 Aug 2005, at 22:02, Glen Bojsza wrote:
> 
> > Hi All,
> >
> > I wish to limit the number of lines (no more than 3) in a field that a
> > user add input.
> >
> > I have tried the following in the field's script
> >
> > on returnKey
> >   if word 2 of the selectedline > 3 then exit returnKey
> > end returnKey
> >
> > on enterKey
> >   if word 2 of the selectedline > 3 then exit enterKey
> > end enterKey
> >
> >
> > But when I hit the enter key after 3 lines it still keeps going to the
> > next line?
> 
> 
> The messages you need to trap are returnInField and enterInField.
> returnKey and enterkey are not sent to fields that are being edited.
> I'm not sure why. It's caught me out a few times.
> 
> Also, you may need to prevent users from pasting more than three
> lines into the field. For that, you could use the pasteKey message.
> 
> Cheers
> Dave
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list