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?
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?
5 Answers, 1 is accepted
0
Accepted
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).
Regards,
Rosen
Telerik
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!
0

Matt
Top achievements
Rank 1
answered on 16 Jul 2014, 03:54 PM
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!" />
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!" />
0
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
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!
0

Matt
Top achievements
Rank 1
answered on 06 Aug 2014, 09:03 PM
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.
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.
0
Accepted
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
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!