This content has been marked as final. Show 3 replies
Well, no. Since as you have pointed out anything based on characters won't work. It is possible I suppose to use a monospaced font then it will always take up the same space.
the width of a text field is the maxWidth that can show. There might be someway to check the length of the typed text and when it gets close to the end stop accepting any new characters. However it wouldn't be totally accurate since you could get less than "m" close to the end, but there would still be room for an "l".
So I guess the real question is, What are you actually trying to do?
I am simply having an input text box, that is later dsiplayed in a dynamic text box.
However I find that users keep on adding too many chars. However like i mentioned the number of chars they can enter totally varies dependant on wjht they are typing. I guess I will just take an average of how many chars can be accepted and set that as the max chars. I assume this is what most sites would do. Thanks J.
Yeah, pretty much that is the usual solution. Plan it like they were "M" and just let the shorter ones end before the end of the text field.
You really could get very involved with measuring the width and all, but for what it seems you are doing that seems like overkill.