How to manually submit a Unity UI input field through code?

I need to add some logic to my input field before it can be submitted, I’m trying to figure out how to submit it through code and I have not come up with any solutions. The OnSubmit event seems to be AFTER it has submitted, I need to control when it submits.


Thanks guys.

new UI system uses UnityEngine.EventSystems framework to pass events.

So you can do something like:

ExecuteEvents.Execute(TargetInputField.gameObject, null, ExecuteEvents.submitHandler);