Attribute validationmessage not allowed on element input at this point.

6 posts, 2 answers
  1. Matt
    Matt avatar
    7 posts
    Member since:
    Dec 2010

    Posted 15 Jul 2014 Link to this post

    I love the Kendo UI Validator, but I hate how it uses an input invalid attribute, "validationmessage", it should be data-validationmessage. Everything else in Kendo UI is done perfectly to match the HTML5 specs, why in this one instance is it different? Every time I run a HTML5 code validator I get this message:

    Attribute validationmessage not allowed on element input at this point.

    Is there anyway around this other than stop using Kendo Validator? Does Telerik have plans to fix this bug in future releases?
  2. Answer
    Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 16 Jul 2014 Link to this post

    Hi Matt,

    Actually there are several ways to set custom validation message text. For example you can set data-[rule]-msg (where  [rule] is the name of the validation rule for which the message should be shown).

    <input type="url" required data-required-msg="You need to enter a URL" data-url-msg="This url is invalid">


    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Matt
    Matt avatar
    7 posts
    Member since:
    Dec 2010

    Posted 16 Jul 2014 in reply to Rosen Link to this post

    That didn't seem to work for me. When I changed it from data-required-message="Please enter your first name!" to data-required-message="Please enter your first name!". It ignores the message I entered and instead shows the value I have for the name attribute and then puts in is required at the end. So the validation windows shows this "first_name is required">

    Below is a sample input field I use on the form.
    <input type="text" id="txtFirstName" required="required" name="first_name" data-required-message="Please enter your first name!"  />
  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 17 Jul 2014 Link to this post

    Hi Matt,

    It seems that you have set the attribute name incorrectly. It should be data-required-msg instead of data-required-message​, note that at the end it is msg not message.

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Matt
    Matt avatar
    7 posts
    Member since:
    Dec 2010

    Posted 06 Aug 2014 in reply to Rosen Link to this post

    One final question.

    How would I show a message for when an input fails the pattern/regex test.

    I tried data-pattern-msg="Invalid entry".

    But that doesn't work.
  7. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 08 Aug 2014 Link to this post

    Hello,

    The attribute name is correct and seems to be working correctly on my side. Please check this example and let me know if I am missing something.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready