Forums

Check username and email Live

omidhz 04 Aug, 2019
I have a custom registration form which is working great and does not allow duplicate username or email as expected AFTER the form is submitted.
Instead of waiting until after the user clicks on submit, I like to add the functionality that the username and email are checked as soon as the user enters them. This will be a better user experience instead of coming back to enter a new username or email.
Any idea how to do this?
healyhatman 04 Aug, 2019
In the field events for your email / username fields (HOT TIP: just use email addresses as usernames and get rid of usernames altogether. Free plugins will modify your login page for you) put an onchange event that reloads a container. In the reload event for that container, check if the email exists and if it does, display an error.

In your container you could have a Custom HTML block with {var:email_check_result} and use a switch called email_check_result set to return as var, with {var.empty:read_data_name} as the data source (true is empty, false is not empty). So in false you could have for example
false:<i class="red cross icon"></i> User with that email already exists
This topic is locked and no more replies can be posted.