Email Validation on a Custom User Registration Form

Hi,

I’m relatively new to coding so apologise for what I’m sure is a basic question. I have created a custom user registration form and am looking to validate an email address inputted by the user before they can “sign up”. I have read lots of different forum posts on this, but can’t seem to get the code to work for me. I have created a collapsed error message that I would like to expand when the email format inputted by the user is invalid, and collapse if it is valid. If the email and other inputs are all valid then I want the user to be able to submit their registration. The code I have is below. Your help is greatly appreciated!

Thank you!

Hi,
in your code, $w(‘#validationMessage’) and validationMessage are two different entities. Assigning “Please sign up with your university…” to validationMessage makes no difference to the text element $w(‘#validationMessage’)
In this particular instance try either of the following prior to calling expand
$w(‘#validationMessage’).text = “Please sign up with your …”
-or-
$w(‘#validationMessage’).text = validationMessage

For more details on how to work with text elements see below:-