<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slvr</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slvr"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Slvr"/>
	<updated>2026-05-03T19:14:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiEditSetMaxLength&amp;diff=21938</id>
		<title>GuiEditSetMaxLength</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiEditSetMaxLength&amp;diff=21938"/>
		<updated>2009-11-14T19:37:35Z</updated>

		<summary type="html">&lt;p&gt;Slvr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets the maximum text length that can be typed into an edit box.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool guiEditSetMaxLength ( element theElement, int length )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&lt;br /&gt;
*'''theElement:''' The edit box to be changed.&lt;br /&gt;
*'''length:''' An integer indicating the maximum number of characters that can be typed into the box.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the max length was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box with a limit on text length, alongside an &amp;quot;Output!&amp;quot; button.  When the button is clicked, it will output the message in the edit box into the Chat Box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our button&lt;br /&gt;
button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
-- create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
-- set a maximum text length of 128 characters&lt;br /&gt;
guiEditSetMaxLength ( editBox, 128 )&lt;br /&gt;
&lt;br /&gt;
-- setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ()&lt;br /&gt;
        local text = guiGetText ( editBox )   -- get the text from the edit box&lt;br /&gt;
        outputChatBox ( text )                -- output that text&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientGUIClick&amp;quot;, button, outputEditBox )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>Slvr</name></author>
	</entry>
</feed>