ID:755376
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
I think it would be great and extra neato if input controls could have a chracter limit. You know, like restricting it to 140 characters for chat, or 16 characters for a username.
This can be done with checks.
mob/verb/Username(m as text){
if(!m || lentext(m)>16 || lentext(m)<=2){
return;}
}
In response to Kozuma3 (#1)
Kozuma3 wrote:
This can be done with checks.
> mob/verb/Username(m as text){
> if(!m || lentext(m)>16 || lentext(m)<=2){
> return;}
> }
>

Yea, but not the same effect as preventing them from typing more than that many characters into the input control.
Ah, I understand now - Misunderstanding , this would be a nice feature (:
One workaround would be to use a HUD input. The one in Forum_account's HUD Groups library is a good example. Just override a proc and perform the check.

It would be nice if the interface controls had "OnChange" events, but they would work better client-sided, which probably brings up a bunch of other unrelated issues.
In response to Kaiochao (#4)
Kaiochao wrote:
One workaround would be to use a HUD input. The one in Forum_account's HUD Groups library is a good example. Just override a proc and perform the check.
It would be nice if the interface controls had "OnChange" events, but they would work better client-sided, which probably brings up a bunch of other unrelated issues.

That actually won't work. Round trip packets for every key press.

It doesn't need to be fancy. All they need to do is allow us a little character limit variable just like it has a password-text-type variable. Its literally almost the same type of option. Client files would already contain the stored maximum amount of input per input control just like it already stores what kind of windows there are, what their names are, their sizes, etc.
I think Lummox JR would be like "NOPE. This'd need native ReGex" or something.
In response to Super Saiyan X (#6)
Super Saiyan X wrote:
I think Lummox JR would be like "NOPE. This'd need native ReGex" or something.

Actually this is no different than allowing us to change the font style of the input control. All they have to do is add this functionality. Windows controls already support this type of functionality. They just need to give us access to it.
You can put the textbox in a browser control and use JavaScript to limit how much is typed in the textbox, but that's probably overkill if you just need it for one input field.
In response to Forum_account (#8)
Forum_account wrote:
You can put the textbox in a browser control and use JavaScript to limit how much is typed in the textbox, but that's probably overkill if you just need it for one input field.

That's not a bad idea. Is there any extra overhead with the browser control? Like if that text box was to be chat input?
In response to FIREking (#9)
FIREking wrote:
Forum_account wrote:
You can put the textbox in a browser control and use JavaScript to limit how much is typed in the textbox, but that's probably overkill if you just need it for one input field.
That's not a bad idea. Is there any extra overhead with the browser control? Like if that text box was to be chat input?

I'm sure it takes more memory to allocate a browser control than to just create a textbox. The most annoying part would be managing keyboard focus. With the Interface library it's pretty easy - you can have a one line JavaScript function call a one line DM proc to set focus back to the map control, but most people wouldn't bother with that. Using a browser control makes more sense if you have a large form you want to validate client-side.
I think this is a very reasonable feature request that would take no time at all to add.