Page 1 of 1

Text box single line

Posted: Tue Feb 15, 2011 12:00 pm
by bsouthuk
HI Guys

I've build a CRM in Runev and I cant work out how to ensure a 1 line text does not allow 2 lines of text in it. I thought I had achived this by changing some of the field settings. i.e. tab after return and Dont Wrap.

However, when my users copy and paste 2 lines of text from a website for instance in the field, it allows both lines to be copied when its important that only the first line is pasted.

Does anyone have any suggestions?

Re: Text box single line

Posted: Tue Feb 15, 2011 12:09 pm
by Klaus
Hi Daniel,

you could trap the "pastekey" message to check
the clipboarddata["text"]
for its number of lines and only "paste" line 1 of it.

Or you can check the field(s) in an "on exitfield" handler and delete the last line if neccessary.

HINT:
The "pastekey" handler will NOT work in the IDE, but in a standalone! :D


Best

Klaus

Re: Text box single line

Posted: Tue Feb 15, 2011 12:24 pm
by bsouthuk
ahhh brilliant thanks Klaus

Re: Text box single line

Posted: Tue Feb 15, 2011 5:40 pm
by dunbarx
Perhaps you can write an "mouseEnter", "openField" handler in your field that would set the clipboardData to line 1 of the clipBoardData?

Craig Newman