Skip to content

Commit 8997bd7

Browse files
Add readme.md file for more information to code context.
1 parent df86ed9 commit 8997bd7

File tree

1 file changed

+22
-0
lines changed
  • Catalog Client Script/MRVS Email Validation with Mutation Observer

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Email Validation on Catalog UI
2+
3+
This file contains a client script that validates email addresses in the MRVS (Multi-Row Variable Set) field using a MutationObserver. The script ensures that duplicate email addresses are not allowed in the catalog.
4+
5+
## File Structure
6+
7+
- `/code-snippets/Catalog Client Script/MRVS Email Validation with Mutation Observer/EmailValidationOnCatalogUI.js`
8+
9+
## Description
10+
11+
The script observes changes in the MRVS field and validates the email addresses whenever a user attempts to add another email. If a duplicate email address is found, an error message is displayed, and the submit button is disabled.
12+
13+
## Usage
14+
15+
1. **onLoad Function**: This function initializes the MutationObserver to watch for changes in the MRVS field.
16+
2. **validateUserDetails Function**: This function checks for duplicate email addresses in the MRVS field.
17+
18+
## How It Works
19+
20+
1. The `onLoad` function sets up a MutationObserver on the MRVS field.
21+
2. When changes are detected, the `validateUserDetails` function is called to check for duplicate email addresses.
22+
3. If duplicates are found, an error message is displayed, and the submit button is disabled.

0 commit comments

Comments
 (0)