- Home /
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.
Thoughts?
Thanks guys.
Answer by mholub · May 09, 2015 at 05:33 PM
new UI system uses UnityEngine.EventSystems framework to pass events.
So you can do something like:
ExecuteEvents.Execute(TargetInputField.gameObject, null, ExecuteEvents.submitHandler);
Oh, good stuff. I see there is a lot more I can do with ExecuteEvents than just this, thanks!
Your answer
Follow this Question
Related Questions
How to supersample TTF text of UI in 3D graphics scene? 0 Answers
How to apply effects to UI Text in Unity 4.6 1 Answer
Canvas Button persistence 0 Answers
Ui text to string ? 1 Answer
How do I call an DontDestroyOnLoad function on UI text 2 Answers