Hi,
Firstly note that you don’t need to use parseInt to check the results length. As for the validation, I recommend using Regex to validate the content of the user input:
Hello again Tal.
I’m checking names against a database so, as far as I’m aware, REGEX isn’t any good.
This check is also updating with each key press and Wix’s default validation checking doesn’t happen until the element has lost focus…
Hey Ido,
Thank you for the video. I have a working query. I can log the results perfectly fine. The problem is the actual TextInput element. I’m trying to flag a custom error on the validation so that it’ll turn red.
I have the same issue - needing to do a DB query inside an input validation function. It appears the results of the query occur “later” and the input validation is already completed. I’d like to block validation until DB query is completed - how? I also tried creating a separate function to do the DB query and passed the ‘reject’ variable to it but that didn’t work either.
How can input validation with a DB query work successfully?