Telerik Forums
Kendo UI for jQuery Forum
1 answer
579 views

Hello!

Kendo Wizard always validates the step forms when navigating between them, even if you press "Previous".

This can be seen in the official sample here:

https://demos.telerik.com/kendo-ui/wizard/index

If you are on Step 2 and press "Previous", you are required to input all data before going back to Step 1.

How can I change this? I want to validate the current step form content only if you press "Next", and allow the user to go back without inserting data if he presses "Previous".

Thanks!

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 24 Aug 2021
0 answers
191 views

I'm trying to get the validation working on my form with kendovalidator

I'm using Telerik ver : 2019.2.619

    $.validator.setDefaults({
        ignore: ""
    });
    $(function () {
        $("#form1").kendoValidator();
    });

this shows validation messages correctly if values are empty eg:

issue is  when an incorrect value is entered the message shows:

 


    <div class="form-group row">
        @Html.LabelFor(model => model.CountryCodeId, htmlAttributes: new { @class = "control-label col-md-2 required" })
        <div class="col-md-10">
            @(Html.Kendo().ComboBoxFor(m => m.CountryCodeId)
                                         .Name("CountryCodeId")
                                        .Placeholder(@Resources.Resources.CountryPlaceholder)
                                        .DataTextField("Description")
                                        .DataValueField("Id")
                                        .Filter("contains")
                                        .Suggest(true)
                                        .DataSource(s => s.Read(r => r.Action("GetCountries", "Customer")).ServerFiltering(false))
                                        .HtmlAttributes(new {  style = "width:300px" })
            )
            @Html.ValidationMessageFor(model => model.CountryCodeId, "", new { @class = "text-danger" })
        </div>
    </div>



        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "CountryValidation")]
        [Display(ResourceType = typeof(Resources.Resources), Name = "Country")]
        public int? CountryCodeId { get; set; }

and if  I enter a number the validation seems to pass, which it shouldn't

Validation should pass only if a country is selected from the combobox, entrering a numeric value or any other text which is not on the list should fail validation

How do I get default dataanotation message if an invalid entry is made?

Thanks

 

Faz
Top achievements
Rank 1
Iron
 updated question on 23 Aug 2021
1 answer
658 views

I'm trying to implement validation on he form , but having issues with radio button.


        <div class="form-group row">
            @Html.LabelFor(model => model.LanguageID, htmlAttributes: new { @class = "control-label col-md-2 required" })
            <div class="col-md-10">
                @(Html.Kendo().ComboBoxFor(m => m.LanguageID)
                                         .Name("LanguageID")
                                        .Placeholder(@Resources.Resources.LanguagePlaceholder)
                                        .DataTextField("Description")
                                        .DataValueField("Id")
                                        .Filter("contains")
                                        .Suggest(true)
                                        .DataSource(s => s.Read(r => r.Action("GetLanguages", "Student")).ServerFiltering(false))
                                        .HtmlAttributes(new {  style = "width:300px" })
            )
                @Html.ValidationMessageFor(model => model.LanguageID, "", new { @class = "text-danger" })
            </div>
        </div>

            <div class="form-group row">
                @Html.LabelFor(model => model.WebsiteDisplay, htmlAttributes: new { @class = "control-label col-md-2 required" })
                <div class="form-group k-radio-list">
                    <div class="checkbox">
                        @(Html.Kendo().RadioButtonFor(m => m.WebsiteDisplay).Label(@Resources.Resources.Yes).Value(true))
                        @(Html.Kendo().RadioButtonFor(m => m.WebsiteDisplay).Label(@Resources.Resources.No).Value(false))
                        @Html.ValidationMessageFor(model => model.WebsiteDisplay, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>



<script>
    $(function () {
        $("form").kendoValidator();
    });

</script>

 

it does work for combobox and textboxes , but error is not displayed for radio button.

Am I missing something?

Stoyan
Telerik team
 answered on 20 Aug 2021
1 answer
831 views

Hello,

Please guide me for change font-size , color or style of the invalid message (see at attahc image)

 

Thank you

Hetali
Telerik team
 answered on 30 Jul 2021
1 answer
425 views

Is there any way of formating a cell on incell editing and making sure that everytime the user leaves the cell, its value is in hh:mm format?

Similar to the editing custom editor example and the unit price column.

I tried the following but it did not make any difference. I am still able to pass whatever value I want. 

...
columns: [
  { field: "time", title: "Time", width: "40px",  attributes: {style: "text-align:left;"}, headerAttributes: {style: "text-align:left;"}, format: "{0:hh:mm}" },      
],
...

I am guessing I will have to combine both datasource validation and the format option in order to achieve what I want. 

 

Thank you in advance,

Syian

Georgi Denchev
Telerik team
 answered on 07 Jul 2021
2 answers
44 views

OK SO this is a little hard to actually explain but- I have a multiselect with a datasource and validation rules, not unlike this demo here. For some reason, it's failing validation even though it has a value. What is going wrong/how can I fix it/what further details do I need to provide?

 

Thank you, I apologize for the poor explanation.

 

 

Neli
Telerik team
 answered on 08 Apr 2021
10 answers
3.4K+ views
Is there a way  to disable automatic validation? I want to validate manually by calling [validate()]. At present it creates red box around my input automatically when [blur] event is fired.
Thanks,
Max
Misho
Telerik team
 answered on 25 Mar 2021
2 answers
94 views

http://jsfiddle.net/qgw2mtcy/

 

We are trying to validate a grid has more than 1 row before the form submission is valid.  For some reason the validation logic does not trigger the custom rule for the grid row count validation.

Eric Garza
Top achievements
Rank 1
 answered on 16 Mar 2021
1 answer
1.0K+ views

Hi,

  I found a sample code to display one validation message for a group of radio buttons above the radio button group, but I am not able to display one message in validation summary.  Please try code snippet below.  You can see the validation message display 5 times in the summary.  I just want one message in summary.  Please help.

 

<div id="form">
    <span class="k-invalid-msg" data-for="test"></span><br/>
    Test 1<input type="radio" name="test" required /><br/>
    Test 1<input type="radio" name="test" required /><br/>
    Test 1<input type="radio" name="test" required /><br/>
    Test 1<input type="radio" name="test" required /><br/>
    Test 1<input type="radio" name="test" required /><br/>
    <button id="post">Post</button>
    
    <div id="step3-validation-summary">

     </div>
</div>

<script>
$(function(){
    var validator = $("#form").kendoValidator({
        rules: {
            radio: function(input) {
                if (input.filter("[type=radio]") && input.attr("required")) {
                    return $("#form").find("[type=radio][name=" + input.attr("name") + "]").is(":checked");
                }
                return true;
            }
        },
        messages: {
            radio: "This is a required field"
        },
        validationSummary: {
                container: "#step3-validation-summary"
            }
    }).getKendoValidator();

    $("#post").click(function() {
        validator.validate();
    });
});
</script>

 

Thanks,

Wesley

Ivan Danchev
Telerik team
 answered on 23 Dec 2020
3 answers
1.7K+ views
Hi , i have the following question , i have a registration form with email, password, and confirm password inside a div wrapper. i would like after the validation checks if all fields are correct and filled to check if the input type password for the label password field and the input type password for the label confirm password field match.
Is there a way to do that with kendo or should i reffer to plain javascript?

thanks in advance
Neli
Telerik team
 answered on 30 Sep 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?