Hi,
Im use datePicker and comboBox inside my grid with required attribute and i have bug with validation template, if you go to this dojo https://dojo.telerik.com/OzojoLed and change
"function categoryDropDownEditor(container, options) {
$('<input required name="' + options.field + '"/>')
.appendTo(container).kendoDropDownList" to .kendoComboBox, then delete value and call validation, it is displayed incorrectly, how i can fix it?
5 Answers, 1 is accepted
In order to position the validation tooltip you can include a span element with k-invalid-msg CSS class as described in the Customization of Tooltip position article. Check out the updated dojo sample below for illustration:
Regards,
Viktor Tachev
Progress Telerik
In order to position the validation tooltip you can include a span element with k-invalid-msg CSS class as described in the Customization of Tooltip position article. Check out the updated dojo sample below for illustration:
Regards,
Viktor Tachev
Progress Telerik
[/quote]
Thanks, it's worked now, but i have emerging problem with displaying multiple validations.
I need all validation templates to be displayed at the bottom of the input.
What i have:
Input with "required" attribute and custom message for that input:
<
input
class
=
"form-control"
name
=
"replaceableUser"
id
=
"replaceableUser"
required
validationMessage
=
"Choose user."
>
then i use two <span> for templates below input
<
span
class
=
"k-invalid-msg"
data-for
=
"replaceableUser"
></
span
>
<
span
class
=
"k-invalid-msg"
data-for
=
"replaceableUser_input"
></
span
>
First shows required validationMessage="Choose user."
Second shows my custom validation
$(
"#replacementForm"
).kendoValidator({
// validateOnBlur: true,
rules: {
if
(input.is(
"[name=replaceableUser]"
)) {
console.log(
"value: "
+ input.val());
console.log(
"index: "
+ $(
"#replaceableUser"
).data(
"kendoComboBox"
).selectedIndex);
if
(input.val() !=
""
& $(
"#replaceableUser"
).data(
"kendoComboBox"
).selectedIndex !=
-1) {
if
(input.val() == 148496) {
console.log(
"ок"
);
return
input.val() == 148496;
}
}
return
true
;
}
}
},
messages: {
invalidUser:
"Choose user from list."
}
});
Sorry send incomplete message.
First problem:
When i focusing <input> and then focus another element or empty space both validations are displayed simultaneously.
How i can first displaying "required" validation for empty value, and then displaying second custom validation for invalidUser? (consistently)
And my custom message does not disappear, although the function ends on the block
return
input.val() == 148496;
I would also like to do such checks on the grid, there is the same combo box, but for now I'm stuck on the usual input :(
When there are multiple custom rules defined in the Validator they will run in order. Validation will stop at the first rule that fails and display the validation message specified for that rule. For more information on using custom validation rules check out the article below:
Regards,
Viktor Tachev
Progress Telerik