Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Viktor 7 posts 78 karma points
    Oct 17, 2023 @ 10:22
    Viktor
    0

    Can't get custom regex validation message to work on property editor in package.manifest - Umbraco v10

    Hi!

    I'm working on a custom plugin.

    I'm trying to get my json property editor to show a custom regex validation error message.

    I can make the regex it self work, but I can't find a way to show a custom validation message.

    Wrong message

    Only the default message is working.

    editor: {
                view: "~/App_Plugins/ImageVaultEditor/imagevaulteditor.html",
                "valueType": "JSON",
                "validation": {
                    "regex": "(^$)|(?:(\"customDescription\"|\"description\")\\s*:\\s*\"(?!\\s*\"\\s*:\\s*)[^\"]+\")", <-- Works great
                    "errorMessage": "Description is mandatory",         <-- Does not work
                    "message": "Description is mandatory",              <-- Does not work
                    "validationMessage": "Description is mandatory",    <-- Does not work
                    "errorMsg": "Description is mandatory",             <-- Does not work
                    "regexMessage": "Description is mandatory"          <-- Does not work
                }
            },
    

    How do I get a custom validation message to work for my editor?

    (I have already attempted to validate it using Angular in the front end without success, so this is my last resort.)

Please Sign in or register to post replies

Write your reply to:

Draft