Someone should really update the documentation to indicate in which version new features were added. Not everyone is running the very latest version.
My company is using UI for ASP.Net MVC version 2019.3. (2020.2 is currenlty being evaluated)
Is my assumption correct that "validationSummary: true" in validator was NOT added until version 2020 R2?
I spent hours trying to figure out why this was not working with 2019.3? :)
I'm building my form dynamically and it can have checkboxes, textboxes, radio buttons, etc. is it possible to connect the validator to those dynamically? Each control will have [required] attach to it, if it's set as a required field by the users when building the form.
so for example:
<
div
id
=
"container"
>
<
input
type
=
"text' id="
new" required/>
<
br
>
<
select
id
=
"ddSalesman"
>
<
option
>select one</
option
>
</
select
>
<
input
type
=
"checkbox"
id
=
"NewOrUsed"
required>
</
div
>
and so on, is there a way to connect the validator to these controls when the users clicks the button?
Hello,
I have this valdiation summary:
<
div
asp-validation-summary
=
"All"
class
=
"text-danger"
>
<
span
class
=
"k-invalid-msg"
data-for
=
"Description"
data-valmsg-for
=
"Description"
id
=
"Description_validationMessage"
role
=
"alert"
>
</
span
>
... more fields
</
div
>
<
textarea
asp-for
=
"Description"
class
=
"form-control mc0"
data-bind
=
"value: ent.Description"
>
</
textarea
>
let viewModel = kendo.observable({
save:
function
() {
let editForm = $(
"#edit-form"
).kendoValidator().data(
"kendoValidator"
);
if
(editForm.validate()) {
this
.entDataSource.sync();
}
},
})
Because of the business rules, I need to validate only certain fields, based on the current entity state.
Is there a way to validate only certain fields, like all fields with class "mc0" (or fields in a "div#id-for-state-X") and have the error messages displayed in the summary?
Thanks.
<
form
action
=
"/"
id
=
"testForm"
>
<
input
type
=
"hidden"
name
=
"__EVENTTARGET"
id
=
"__EVENTTARGET"
value
=
""
/>
<
input
type
=
"hidden"
name
=
"__EVENTARGUMENT"
id
=
"__EVENTARGUMENT"
value
=
""
/>
<
input
type
=
"text"
id
=
"testInput"
value
=
""
>
<
a
id
=
"testValidate"
href
=
"javascript:;"
>Validate</
a
>
</
form
>
var
validatable = $(
"#testForm"
).kendoValidator({
rules: {
testRule1:
function
(input) {
// Only "Tom" will be a valid value for the FirstName input
return
input.is(
"[name=firstname]"
) && input.val() ===
"Tom"
;
},
testRule2:
function
(input) {
return
$.trim(input.val()) !==
""
;
}
},
messages: {
testRule1:
"Your name must be Test"
,
testRule2:
"Your name must be Foo"
}
}).data(
"kendoValidator"
);
$(
"#testValidate"
).click(
function
() {
if
(validatable.validate()) {
alert(
'passed'
);
}
});
I have a checkbox group and only want to make sure what is checked if required.It's validating all checkboxes, I only to validate the group is required.
this creates textboxes on the page, and it can be 1 or many, however, if x.Required is true, I only want to validate the group not each checkbox. Is that possible with the validator or no, if not, can I remove the checkboxes from the validator since they have an input tag with textboxes?
foreach(var x in group)
{
<
input
type
=
"checkbox"
name
=
"@x.Location"
value
=
"@x.Text"
required
=
"@x.Required"
/>
}
Hello,
I'm trying to customize a span element to look like a validation popup with the arrow on top pointing to an input element. I am not able to use validation in this case, and I'm trying to display a tooltip instead. I have the following:
<
span
id
=
"validation"
class
=
"k-widget k-tooltip k-tooltip-validation k-x-invalid-msg-block"
></
span
>
The code above almost works, however, the little directional arrow on top of the span is not displayed. If I include 'k-callout' and 'k-callout-n' then the entire span moves and is distorted. Can anyone help me get the little arrow to show up? Any help is appreciated. Thanks!
I have an issue when using server side validation with the Kendo validator. When the input has focus, the server side validation seems to occur 3-4 times per second hitting the server. This only happens when there is an error, and the server returns false (something was not validated correctly). The server side validation occurs rapidly after that and it seems to slow down the browser, and when the user corrects the value and clicks on the submit button, the browser stops processing and freezes until you hit the submit button again. The browsers performance is degraded as well.
Can I slow down how often I hit the server when there was an error? Any suggestions would be welcome.
The approach that I developed is at http://gregoryalexander.com/blogCfc/client/index.cfm/2019/3/1/Kendo-Server-Side-Validation.
Hit the comment button on this thread, make a mistake on the captcha text, fix it to replicate.
Is it possible to have multiple validator initializations on different div tags? Basically I'm wanting to do a wizard (without the use of the progress bar) and I want to validate one div tag per "next" button.
function ShowSection2()
{
//validation
var validator = $("#Section1").kendoValidator().data("kendoValidator");
if (!validator.validate())
{
return;
...
function ShowSection3()
{
//validation
var validator = $("#Section2").kendoValidator().data("kendoValidator");
if (!validator.validate())
{
return;
...