InputText, done button question

How do i call a function/method when i press the done or the ok button? (the blue one)

What have you tried so far? Have you checked the documentation?

Maybe you are looking for onValidateInput

public InputField mainInputField;

public void Start()
{
   mainInputField.onValidateInput += OnInputValidated;
}

private void OnInputValidated(string input, int charIndex, char addedChar)
{
    Debug.Log( input ) ;
}