Trigger 'if' statement while in TextField

I have a GUI.TextField in a unity project and the string from it is used to trigger other scripts and events. The boolean that confirms the button is pressed (passing that confirmation to other scripts) is turned to True when “Return” is pressed on the keyboard. The problem is, pressing Return only works once the user has clicked out of the TextField. I want the return key to work as trigger when the user hits it after typing (whilst still accessing the TextField).
My GUI method is as follows:

	void OnGUI()
	{
		GUILayout.Label("Find Places");
    	search = GUI.TextField(new Rect(10, 10, 200, 20), search, 25);
	//static function TextField (position : Rect, text : String, maxLength : int) : String
	
	  if (Event.current.Equals(Event.KeyboardEvent("return")))
		{
		confirm = true;	
		}
		else
		{
		confirm = false;	
		}
	}

void OnGUI()
{
GUILayout.Label(“Find Places”);
search = GUI.TextField(new Rect(10, 10, 200, 20), search, 25);
confirm = Event.current.character == ’
';
}

Maybe try a simple Input.GetKeyDown(“return”) in the Update function.

void Update()

{

if(Input.GetKeyDown(“return”)

{

confirm = true;
}

}