1 person found this helpful
Do you want to do it after the fields have been filled, or at the moment the
user exits the field after having entered a value?
Thanks for the quick response. That's a great question that I don't really have an answer for from a requirements stand point.
What we have is an end-user tool that only allows a certain amount of characters per line and only a certain amount of lines. So we're faking some of this by having a single text field represent a single line with a character counter set on it and a max character limit set as well. Then theres a script running that focuses you to the next field as you've filled out each one. We just want to make sure that at the very end there's a hard return added to every line (text field) so when our client copies and pastes this it holds the formatting. Make sense?
I guess whatever would be easiest is my best response to you. Maybe when they exit the field would make sense?
I think the best option is to do it just before the file is closed. That way
it's not interfering with the user's input.
However, it might be problematic if the field is already full. I'm not sure
you will be able to add an extra character to a full field.
Can you clarify (in words, not code) exactly which character(s) you want to add? It looks like you may be trying to add a carriage return to the end of a text field value, but this is not possible for non-multiline text fields. Any carriage return (or newline) characters get converted to spaces for non-multiline fields. For multiline fields, newlines (\n) get converted to carriage returns (\r), which have the same effect.
Did you set a character limit for the field?
Yes we'll need a carriage return added to the end of the fields. If it has to be changed to a multiline field that's not a problem. We'd like to have a max character amount set to the field as well and had assumed the last one could count as the carriage return. So, if we wanted 20 characters on a line, we'd set the max to 21 in order to hold the return.
Is this possible?
Thanks for all the responses. I've been learning a lot on here today.
I think the easiest way to get what you want is to keep the single line fields for user entry and then set up a separate multiline field that takes the contents of the individual fields and concatentates the values, adding carriage returns along the way. You can do this with a custom Calculate script in the multiline field. The text could then be copied from the multiline field when it later needs to be pasted into the other system. You can set it up the field in an out of the way area with white text so it's not noticable, but the end user would know where to go to copy it from. If this sounds feasible and you need help with the code, post again.
Just checked, and if the field has a maximum limit of characters then you can't add more characters to it, unless you also change the charLimit property before.