Wrap Text Maximum Characters

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Wrap Text Maximum Characters

Post 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!
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Wrap Text Maximum Characters

Post 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
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Wrap Text Maximum Characters

Post 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.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Wrap Text Maximum Characters

Post 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.
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Re: Wrap Text Maximum Characters

Post 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!!!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest