Jump to content

limiting text field sizes


This topic is 5766 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am using a calc ( field1 & field2 ) in a portal.

I would like field1 and field2 to line up one under each other like columns; however, the charcater count for field1 varies ...

Is there a way to define the length of field1 so that if there are say, five characters, the field length remains the equivalency of say fifteen characters, so that the values for filed2 always start in the same place in the portal layout?

I have tried several calc definitions like Length, etc. and there doesnot seem to be something like characterCount = 15.

Is this the best way to accomplish this or it there some other approach that would work better?

Link to comment
Share on other sites

Thanks -- I was just considering if there was a "tab" symbol when I saw your post.

When I try your idea, field1 & ¶ & field2, it created a second line (like a paragraph return) on the portal field looking like:

Field1

Field2

rather than on the same line where field2 is always a specific distance from the first character of field1 ....

Link to comment
Share on other sites

If you want to line them up on the same line, there are a few different ways you could do this -

1) Use paragraph tabs. They are kinda a pain to set up, but are a simple, elegant way to do it.

2) Create a calculated field that determines the character length of the first field, and then adds as many spaces as needed to align correctly. This will only really work if you are using a courier font, or a font that uses the same width for each character. Otherwise, each line won't line up precisely. The calc is something like this, presuming Field 1 won't be more than 15 characters long -

Field1 & Left ( " "; (16 - Length ( Field1 ) ) ) & Field 2

For this to work you must make absolutely sure that the first field won't be any longer than what you define as. Using validation is one way to make sure this is enforced.

3) Place the fields individually on the portal row, instead of using a calc. Field 1 would have to be long enough to accomodate the minimum amount of characters you define.

Link to comment
Share on other sites

I would like field1 and field2 to line up one under each other like [color:red]columns

I was reading right, you said: columns, not the same line ! :P

BTW: you can insert a TAB (or more than one, if you wish) in the calc, by pressing CTRL+TAB so your calc will be:

field1 &"CTRL+TAB"&field2

Link to comment
Share on other sites

This topic is 5766 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.