Page 1 of 1

Wrap Text Maximum Characters

Posted: Fri Oct 12, 2012 3:00 pm
by emhill
Is there a way to stop the user from entering data into a text area when they reach a certain number? I have a text area bound to a field that is 160 characters and then in my RPG I have logic that will break that out into four 40 character fields.

Just wondering if I the text area can stop the user at a certain point?

Thanks!

Re: Wrap Text Maximum Characters

Posted: Fri Oct 12, 2012 6:26 pm
by Alex
Hello,

The way to do that is to bind the text area to a field that has a length where you want to stop the user from typing.

So, if you bound the text area to a 160 character field, it should not let them type beyond character 160. Is this not working for you?

Alex

Re: Wrap Text Maximum Characters

Posted: Fri Oct 12, 2012 6:42 pm
by Scott Klement
Like Alex said, PUI should automatically limit the total length of the data to 160 characters if it's a 160 character field.

But, I don't think there's any way to control how many characters are on each line of the text area (except, perhaps, writing your own JavaScript routine to control this.)

For example, if your program breaks the text area into 4 lines of 40 characters each, the user could position the cursor halfway across the first line and hit enter. This would result in 5 total lines, two of them with 20 characters, followed by 3 with 40 characters each.

Or they could delete characters from the middle, causing some lines to be shorter than others.

I don't know if any of that is a problem for you or not, but I thought it was something to consider.

Re: Wrap Text Maximum Characters

Posted: Fri Oct 12, 2012 7:01 pm
by Alex
I think I see what you are asking now. You are looking to limit each line. There isn't really a way, but I can suggest some "tricks" that can make it appear as if there is a limit for each line.

One method is to set the text area font to a Monospace font. Then, set the width of the text area to show exactly 40 characters on each line.

Another method would be to create 4 text boxes and place them vertically right against each other. Then, set the "border bottom style" to "none" on all but the last text box. Also, set "border top style" to "none" on all but the first text box. This will make the boxes blend together, kind of like one text area, even though they are 4 separate text boxes.

Re: Wrap Text Maximum Characters

Posted: Mon Oct 15, 2012 9:26 am
by emhill
Thanks all. I must not have been counting correctly in my head as I was keying because I could have sworn that I was going over the 160 characters I had defined in my bound field. :-)

Thanks again for the prompt replies!!!!