> 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/toggleinputfield.md).

# ToggleInputField

{% 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...
		if( Input.GetKeyDown( KeyCode.Return ) )
        	{
        		// Toggle the state of the input field.
        		chatBox.ToggleInputField();
        	}
	}
}
```

{% endcode %}
