Limit amount of text in an input object - can it be done?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mrdude
    Forum Member
    • Jun 2004
    • 143

    Limit amount of text in an input object - can it be done?

    Hi is there any way to limit the amount of text someone can enter into an input object to a specific amounnt of characters?

    For example say I had an object and I only wanted a user to put a maximum of 160 letters or numbers in that object then a message would pop up saying that they have exceeded that limit - would that be possible?

    I know I can strip letters from an object left or right - but limiting the amount in the first place is another story?
  • imhotep
    Forum Member
    • Feb 2004
    • 40

    #2
    Originally posted by mrdude View Post
    Hi is there any way to limit the amount of text someone can enter into an input object to a specific amounnt of characters?

    For example say I had an object and I only wanted a user to put a maximum of 160 letters or numbers in that object then a message would pop up saying that they have exceeded that limit - would that be possible?

    I know I can strip letters from an object left or right - but limiting the amount in the first place is another story?

    yes in input settings choose inputmask see help file

    Comment

    • holtgrewe
      Indigo Rose Customer
      • Jul 2002
      • 779

      #3
      Originally posted by mrdude View Post
      Hi is there any way to limit the amount of text someone can enter into an input object to a specific amounnt of characters?

      For example say I had an object and I only wanted a user to put a maximum of 160 letters or numbers in that object then a message would pop up saying that they have exceeded that limit - would that be possible?

      I know I can strip letters from an object left or right - but limiting the amount in the first place is another story?
      I think there is a post with better code than this but here's one way. (example limits 5 characters), placed in the On Key event of the input object.

      Code:
      txt = Input.GetText("Input1")
      if String.Length(txt) > 5 then
      	Dialog.Message("", "input > 5")
      	Input.SetText("Input1", String.Left(txt,5))
      end

      Comment

      • mrdude
        Forum Member
        • Jun 2004
        • 143

        #4
        Thanks guys, I will give that a go. Cheers

        Comment

        Working...
        X