Skip to content

Conversation

@Dhruvyadav2000
Copy link
Contributor

@Dhruvyadav2000 Dhruvyadav2000 commented Oct 22, 2025

PR Description:

Add Real-Time Email Validation for Catalog Items

Summary

Implements onChange email validation client script that provides instant feedback as users type in email fields.

Changes

  • onChange Validation Client Script: Real-time email format validation
  • Dedicated README: Implementation guide for onChange script

Features

  • Instant validation feedback during user input
  • Dynamic error/success messages
  • Automatic message clearing based on validity
  • Skips validation during form loading
  • Uses regex pattern for standard email format

User Experience

  • Invalid email: Red error message with example format
  • Valid email: Green confirmation message
  • Empty field: No validation triggered
  • Reduces user frustration with immediate feedback

Benefits

  • Improved user experience with instant validation
  • Errors corrected before form submission
  • Better data quality in catalog requests
  • Reduces form abandonment rates

Testing Checklist

  • Valid email formats show success message
  • Invalid formats display error message
  • Messages clear dynamically on input change
  • No validation during form load
  • Empty fields handled correctly

Setup

Replace 'email_field_name' with actual variable name in script before deployment.

Pull Request Checklist

Overview

  • Put an x inside of the square brackets to check each item.
  • I have read and understood the CONTRIBUTING.md guidelines
  • My pull request has a descriptive title that accurately reflects the changes and the description has been filled in above.
  • I've included only files relevant to the changes described in the PR title and description
  • I've created a new branch in my forked repository for this contribution

Code Quality

  • My code is relevant to ServiceNow developers
  • My code snippets expand meaningfully on official ServiceNow documentation (if applicable)
  • I've disclosed use of ES2021 features (if applicable)
  • I've tested my code snippets in a ServiceNow environment (where possible)

Repository Structure Compliance

  • I've placed my code snippet(s) in one of the required top-level categories:
    • Core ServiceNow APIs/
    • Server-Side Components/
    • Client-Side Components/
    • Modern Development/
    • Integration/
    • Specialized Areas/
  • I've used appropriate sub-categories within the top-level categories
  • Each code snippet has its own folder with a descriptive name

Documentation

  • I've included a README.md file for each code snippet
  • The README.md includes:
    • Description of the code snippet functionality
    • Usage instructions or examples
    • Any prerequisites or dependencies
    • (Optional) Screenshots or diagrams if helpful

Restrictions

  • My PR does not include XML exports of ServiceNow records
  • My PR does not contain sensitive information (passwords, API keys, tokens)
  • My PR does not include changes that fall outside the described scope

@Atul-LNG Atul-LNG self-assigned this Oct 22, 2025
@Atul-LNG Atul-LNG merged commit 2ad4dcc into ServiceNowDevProgram:main Oct 22, 2025
2 checks passed
@Atul-LNG
Copy link
Contributor

Thanks @Dhruvyadav2000, for your contribution.

@ravichandra1998g
Copy link
Contributor

Hello @Dhruvyadav2000

The on change client script executes whenever the field value changes and it doesn't execute real time as you mentioned in the Readme File and Description.

Can you please attach the screenshots for this functionality?

@ravichandra1998g ravichandra1998g self-requested a review October 22, 2025 10:40
@ravichandra1998g ravichandra1998g self-assigned this Oct 22, 2025
ravichandra1998g added a commit that referenced this pull request Oct 22, 2025
@ravichandra1998g ravichandra1998g added the invalid This doesn't seem right label Oct 22, 2025
ravichandra1998g added a commit that referenced this pull request Oct 22, 2025
@Dhruvyadav2000
Copy link
Contributor Author

Hello @Dhruvyadav2000

The on change client script executes whenever the field value changes and it doesn't execute real time as you mentioned in the Readme File and Description.

Can you please attach the screenshots for this functionality?

Hi @ravichandra1998g , by real time I meant on the form when user is still editing the catalog item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants