UITextField input data problem

  • Hello everyone,


    is it possible to have an on-value-changed event or something for the text field? I am currently struggling to synchronize the input with my validator. I've a status value for each input which decides if an input is valid or not. Each time the submit button gets clicked the inputs are validating. Only if all inputs are validated the submit button will continue with the process. The only issue I've now since the way to fetch text data is a callback the status value isn't synchronized with the current status value, it's always one step behind. To avoid this problem you have to click twice on the button which is really annoying. It'd be a huge help if anyone knows a solution.


    Here's a small demonstration to visualize the problem:


    Here's the code snippet of my method:

  • It sounds like the main issue is that you call validateText when pressing the button, but since you have to wait for the callback results of multiple text fields, you can't just continue there? There is unfortuantely no way to get the text content of a text field directly (because the server first has to query if from the client)... but you could try the PlayerUIInputTextEvent - it's called once the player either presses enter (after typing a text) or when the text field lost focus. You could move the validation there and store the result for that text field, so when the player presses "Submit", you could just rely on the stored validation result :)

  • It sounds like the main issue is that you call validateText when pressing the button, but since you have to wait for the callback results of multiple text fields, you can't just continue there? There is unfortuantely no way to get the text content of a text field directly (because the server first has to query if from the client)... but you could try the PlayerUIInputTextEvent - it's called once the player either presses enter (after typing a text) or when the text field lost focus. You could move the validation there and store the result for that text field, so when the player presses "Submit", you could just rely on the stored validation result :)

    Thank you, thats what I was looking for lol. Idk how I overlooked something like that.. I probably should sleep more

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!