- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 11:50 PM
I have a single line text field called "email address", need to have a validation check for that field, if there is already email available in the user table which is same as the end user entered, we should throw the error saying that this email address is already exist,please choose different one.
Please help me in script part for this.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2024 05:47 PM - edited ‎03-16-2024 06:19 PM
Hi @Archana23 sorry while copying client script i missed a line where there is a error in your client script your not comparing answer is true which is failing . Corrected below check bolded line which is missing in your code
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 04:48 AM
Hi Harish,
Thanks for sharing the code, it is working as expected but whenever we enter the email address which is not in the user table , at that time also it is displaying the error.
Could you please check that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 05:28 AM
Hi @Archana23 could you please share your script include and client script code here?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 05:33 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 07:15 AM - edited ‎03-15-2024 07:16 AM
Hi @Archana23 can you Replace the if(email.hasNext())
{
return " email already exist";
}
To
return email.hasNext() ? 'true' : 'false';
and in client script
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 09:57 AM
After replacing the code as above, it is showing the alert to true, and it is not displaying the alert like this email is already exist and if the email is not avialble in the user table also, it is not showing any error , it is showing the alert to true in both the cases.