Hi, I have created some simple form validation to validate a form.
The validation works as it should, the problem I am having is that after the form successfully submits, the error error messages appear, even though the form contains no content. please see attached screen shot.
I feel like something is happing with the Wix Code form validation that is conflicting with my validation. Any help would be appreciated.
Thanks for your reply Ido.
Unfortunately we have tried that method previously, and it resulted in the validation being applied on page load (as shown below)
This was undesired as we only wish it to be checked when the box is exited.
Do you know if there may be a way to hook into the default validation event used by the text box?
Any ideas would be appreciated
Your validation is alerting when the length is 0, and submitting clears the input.
Therefore, I suggest the following approach:
Try to determine whether is input is empty after a submission.
I suggest creating your own ‘onClick’ function for your submit button.
The click will submit to the database (using wixData.insert() ) and remove the validation.
Next thing to do is get the validation back up when an input is being focused again.