How to allow only single line into text field (instead of mutliple line)

Jonathan Lynch jonathandlynch at gmail.com
Wed Jan 25 15:58:33 EST 2006


You also need to bear in mind the danger of a user pasting in text that
includes a linefeed.

I accomplish this with a rawkeydown handler that blocks the return and enter
keys, and that checks for ctrl-C and the insert key, and if it detects them,
replaces linefeed with empty before inserting the text to be pasted.

An easier approach (if acceptable for your app) is to also check after the
fact:

on Closefield
  replace linefeed with empty in me
end Closefield

on exitfield
  closefield
end exitfield


The exitfield handler in this case is necessary to cover for situations
where the user pastes text, then gets out of the field without typing
anything.



On 1/25/06, MITTAL Pradeep Kumar <PradeepKumar.MITTAL at insead.edu> wrote:
>
> Here is how you can achive this.
>
> on enterinfield
> put line 1 of me into me
> end enterinfield
>
> on returninfield
> put line 1 of me into me
> end returninfield
>
> bye
> pradeep
>
>
>
>        -----Original Message-----
>        From: MITTAL Pradeep Kumar
>        Sent: Wednesday, January 25, 2006 8:12 PM
>        To: 'use-revolution at lists.runrev.com'
>        Cc: DAHIYA Nitesh; JAMKAR Kapil
>        Subject: How to allow only single line into text field (instead
> of mutliple line)
>
>
>        Hello,
>
>        When I create a text field in the rev, then one can enter the
> mutliple lines in the text field by using enter key.
>
>        Can anyone tell me what to configure so that text filed allow
> only one line of text ?
>
>        Thanks for your help
>
>        Best Regards
>        Pradeep
>
>
> _______________________________________________
> 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