Charanjeet hacktoberfest#2#2175
Conversation
This document explains the User Location Validator solution, detailing how it restricts form submissions based on user location.
This document explains the User Location Validator solution, which restricts ServiceNow form submissions based on user location. It details the functionality of the Script Include and Client Script involved in the validation process.
| var allowedLng = locData.longitude; | ||
| var locName = locData.name; | ||
|
|
||
| var R = 6371; |
There was a problem hiding this comment.
@Charanjet
Could you please explain and add comment here line number 18 ?
| @@ -0,0 +1,4 @@ | |||
| User Location Validator | |||
There was a problem hiding this comment.
Could you please add more comments to your read me file with an output ? This will help to understand How the current user location is fetched& get evaluated with defined range.
|
Thanks for your ocntribution, the use case and script looks good with unique contribution. Helpful if you can add more information to readme file and re-open this PR to consider this submission. Please refer comment added to update the script file with more comment that helps to understand for what purpose var R is defined and using static value. |
PR Description:
Adds a dynamic user location validation script, comparing browser geolocation against the user’s assigned location in ServiceNow. Includes both a server-side Script Include and client-side Validator to block form submission if the user is outside the approved area. Folder references for both components are provided in the README.
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions