# 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 %}
