You can also put this on a text object "OnSetText" (where 5 = number of characters from the left you want to stop at).
This will only show once you type in sequence, you won't see this is layout. It will also work for datalinq objects.
Original Message:
Sent: 06-09-2023 09:02
From: Bob
Subject: Xpression - constrain user input text?
And the expert approach! Always good to see how to do it scripted.
Original Message:
Sent: 6/9/2023 4:28:00 AM
From: Roma
Subject: RE: Xpression - constrain user input text?
Here is another way. Put the script into input text object
Dim charlist() As Char = {" ", Chr(10), Chr(13), Chr(9)} Text = Text.Trim(charlist)
------------------------------
Roman Yaroshenko
chief specialist
RBC-TV
Moscow Russian Federation
Original Message:
Sent: 06-08-2023 10:45
From: Bob
Subject: Xpression - constrain user input text?
Yes, so easy! Just set a hard limit of 5 characters. It'd been so long I forgot that was there. Thanks!
------------------------------
Bob Woodhead
Johns Creek United States
Original Message:
Sent: 06-08-2023 10:22
From: Garrett
Subject: Xpression - constrain user input text?
Just guessing here. I doubt that you can prevent a line return from being in a text box. If you want it to be free to type whatever into that box, a line return is a character that can be typed.
On the character limit. That is an option on layout side to select to max a maximum number of characters available in a text box. - https://youtu.be/qnU0C09avdU
------------------------------
Garrett Hall
Overtime Elite
Original Message:
Sent: 06-07-2023 09:39
From: Bob
Subject: Xpression - constrain user input text?
Novice Xpression user, modifying a project I built during training. Project took user text input, converted to time format, did some stuff, then spit out a countdown time. Works great except if the user added a line return in the published target time input. So I'm looking to constrain user input, preferably to 5 characters (eg, 09:55) with no ability to add line returns. Thoughts? Thanks in advance!
------------------------------
Bob Woodhead
Johns Creek United States
------------------------------