View Full Version : Limit amount of text in an input object - can it be done?
mrdude
06-22-2008, 04:26 PM
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
06-22-2008, 05:22 PM
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
holtgrewe
06-22-2008, 05:26 PM
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.
txt = Input.GetText("Input1")
if String.Length(txt) > 5 then
Dialog.Message("", "input > 5")
Input.SetText("Input1", String.Left(txt,5))
end
mrdude
06-22-2008, 11:57 PM
Thanks guys, I will give that a go. Cheers
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.