Hello @nusrat_jahan,
I assume you want to force the author to create human readable node/page-name or to generate SEO friendly URL.
In such case, instead of breaking into OOTB JS validation, I would suggest to do the following
- Implement a replication pre-processor (https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/replication/Preprocessor.html)
- With in that, check if you have custom validation is enabled or not, based on that block or allow the page from being published
Justification of this solution would be:
- Readable name or SEO friend URL is mainly the ask for publisher
- Author can anyway go ahead and update the node name (by move operation)
- Keeping the OOTB validation (in page properties) intact
See if this solution make sense, please let me know..
Thanks