Garry's Mod Wiki

Garry's Mod Wiki

  boolean DTextEntry:AllowInput( string char )

Description

Called whenever the value of the panel has been updated (whether by user input or otherwise).

It allows you to determine whether a user can modify the TextEntry's text.

By default, this only checks whether the panel disallows numeric characters, preventing it from being edited if the value contains any.

This is actually an engine hook that only works on TextEntry derived elements.

If you are looking for a way to modify character limits, see Panel:SetMaximumCharCount

Arguments

1 string char
The last character entered into the panel.

Returns

1 boolean
Return true to prevent the value from changing, false to allow it.

Example

Prevents the user from editing the text entirely.

local TextEntry = vgui.Create( "DTextEntry" ) TextEntry.AllowInput = function( self, stringValue ) return true end
Output: The panel does not allow any alterations.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...