This is a migrated thread and some comments may be shown as answers.

Attribute validationmessage not allowed on element input at this point.

5 Answers 540 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 15 Jul 2014, 04:48 PM
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?

5 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 16 Jul 2014, 01:10 PM
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!
 
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!"  />
0
Rosen
Telerik team
answered on 17 Jul 2014, 08:12 AM
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!
 
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.
0
Accepted
Daniel
Telerik team
answered on 08 Aug 2014, 02:27 PM
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!
 
Tags
Validation
Asked by
Matt
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Matt
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or