[ARCHIVED] Trying to add validation to the default Email text box with Custom JS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018
05:10 PM
Hi All,
We have a requirement to add additional formatting rules to the email passed through the registration page. We need to confirm that the email has our domain name and is not using a particular uid.
I have created my own html text input, set the Catalog email text box display to none and want to pass through the only the input that meets our requirements. I would like to the default error messages to invoke as usual when an invalid email is passed. I find I can populate the field with .value, but don't get the error message.
I have set
emailInputElement.style.display="none";emailInputElement.tabIndex=-1;
....emailInputElement.value = " ";
emailInputElement.click();anotherElementWithFocus.focus();
Any recommendations?
Thanks,
Simon
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018
05:15 PM
I resolved the issue with this
displayRMTIEmailErrorMessage(theTextInput);
setTimeout(() => {
theTextInput.childNodes[0].focus();
}, 20);
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.