> For the complete documentation index, see [llms.txt](https://docs.tankandhealerstudio.com/assets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tankandhealerstudio.com/assets/ultimatechatbox/documentation/ultimatechatbox/public-methods/disableinputfield.md).

# DisableInputField

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```csharp
using UnityEngine;
using TankAndHealerStudioAssets;

public class ChatBoxExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateChatBox chatBox;

	void Update ()
	{
		// If the Return key was pressed this frame and the input field is currently enabled...
		if( Input.GetKeyDown( KeyCode.Return ) && chatBox.InputFieldEnabled )
        	{
        		// Disable the input field.
        		chatBox.DisableInputField();
        	}
	}
}
```

{% endcode %}
