Telerik Forums
UI for ASP.NET Core Forum
5 answers
688 views

Hi Experts,

    I am using kendo-validator to validate the input controls like (Textbox, Dropdown etc.)

The validation for empty field is working if i move one control to another control using Tab.

I needed that all validation for empty fields should triggered on form submit, not on Tab.

The sample code is below.

<div class="row">
    <div class="col-md-4">
        <form id="addfacility" asp-action="Add" kendo-validator="true">
            <div asp-validation-summary="ModelOnly" class="text-danger" style="width:900px;"></div>

            <div class="form-group" style="width:400px;">
                <label asp-for="Name" class="control-label"></label>
                <input asp-for="Name" class="form-control" maxlength="200" style="width:300px" />
                @*<span asp-validation-for="Name" class="text-danger" style="width:500px"></span>*@
            </div>
            <div class="form-group" style="width:400px;">
                <label asp-for="Address.Address1" class="control-label"></label>
                <input asp-for="Address.Address1" class="form-control" maxlength="100" style="width:300px" />
                @*<span asp-validation-for="Address.Address1" class="text-danger"></span>*@
            </div>
            <div class="form-group" style="width:400px;">
                <label asp-for="Address.Address2" class="control-label"></label>
                <input asp-for="Address.Address2" class="form-control" maxlength="100" style="width:300px" />
                @*<span asp-validation-for="Address.Address2" class="text-danger"></span>*@
            </div>
            <div class="form-group" style="width:400px;">
                <label asp-for="Address.City" class="control-label"></label>
                <input asp-for="Address.City" class="form-control" maxlength="50" style="width:200px" required="required" title="City field is required."/>
                @*<span asp-validation-for="Address.City" class="text-danger"></span>*@
            </div>
            <div class="form-group">
                <label asp-for="Address.State" class="control-label"></label>

                @(Html.Kendo().DropDownListFor(x => x.SelectedStateId)
                                                                    .OptionLabel("--Please Select--")
                                                                    .DataTextField("Name")
                                                                    .DataValueField("EntityId")
                                                                    .BindTo(Model.StateList)
                                                                    .HtmlAttributes(new { required = "required", validationmessage = "The State field is Required.", @class = "form-control", style = "width: 200px;" })
                )

                @*<span asp-validation-for="SelectedStateId" class="text-danger"></span>*@

            </div>
            <div class="form-group">
                <label asp-for="Address.Zip" class="control-label"></label>
                <input asp-for="Address.Zip" class="form-control" maxlength="5" style="width:75px" />
                @*<span asp-validation-for="Address.Zip" class="text-danger"></span>*@
            </div>
            <div class="form-group">
                <label asp-for="Address.County" class="control-label"></label>
                <input asp-for="Address.County" class="form-control" maxlength="50" style="width:200px" />
                @*<span asp-validation-for="Address.County" class="text-danger"></span>*@
            </div>
            <div class="form-group" style="width:400px;">
                <label asp-for="Phone" class="control-label"></label>

                @(Html.Kendo().MaskedTextBoxFor(x => x.Phone)
                                                                    //.Name("Phone")
                                                                    .Mask("000-000-0000")
                                                                    .HtmlAttributes(new { @class = "form-control", style = "Width:130px" }
                                                                )
                        //.Value(Model.PhoneNumber.Number)
                )
                <span asp-validation-for="Phone" class="text-danger"></span>

            </div>
            <div class="form-group">
                <label asp-for="Ext" class="control-label"></label>
                <input asp-for="Ext" class="form-control" maxlength="4" style="width:75px" />
                @*<span asp-validation-for="Ext" class="text-danger"></span>*@
            </div>
            <div class="form-group">
                <label asp-for="Email" class="control-label"></label>
                <input asp-for="Email" class="form-control" style="width:300px" maxlength="255"/>
                @*<span asp-validation-for="Email" class="text-danger"></span>*@
            </div>
            <div class="form-group">
                <label asp-for="Status" class="control-label"></label>
                @(Html.Kendo().DropDownListFor(x => x.SelectedStatusId)
                                                                    //.Name("Status")
                                                                    .DataTextField("Text")
                                                                    .DataValueField("Value")
                                                                    .BindTo(Model.StatusList)
                                                                    .HtmlAttributes(new { @class = "form-control", style = "width: 130px;" })
                //.Value(Convert.ToString((int)Model.Status))

                )
                @*<span asp-validation-for="SelectedStatusId" class="text-danger"></span>*@
            </div>
            <div class="form-group">
                <label asp-for="Organization" class="control-label"></label>
                @(Html.Kendo().DropDownListFor(x => x.SelectedOrganizationId)
                                                                    .OptionLabel("--Please Select--")
                                                                    .DataTextField("Name")
                                                                    .DataValueField("EntityId")
                                                                    .BindTo(Model.OrganizationList)
                                                                    .HtmlAttributes(new { required = "required", validationmessage = "The Organization field is Required.", @class = "form-control", style = "width: 300px;" })

                )
                @*<span asp-validation-for="SelectedOrganizationId" class="text-danger"></span>*@

            </div>
            <div class="form-group">

                <label asp-for="FacilityType.Name" class="control-label"></label>
                @(Html.Kendo().DropDownListFor(x => x.SelectedFacilityTypeId)
                                                                    .OptionLabel("--Please Select--")
                                                                    .DataTextField("Name")
                                                                    .DataValueField("EntityId")
                                                                    .BindTo(Model.FacilityTypeList)
                                                                    .HtmlAttributes(new { required = "required", validationmessage = "The FacilityType field is Required.", @class = "form-control", style = "width: 300px;" })

                )
                @*<span asp-validation-for="FacilityType" class="text-danger"></span>*@
            </div>

            <div class="form-group">
                <br />
                <input type="submit" value="Add" class="btn btn-primary" />
                &nbsp;&nbsp;
                <input type="button" value="Cancel" class="btn btn-primary" onclick="location.href = '@Url.Action("Index", "Facility")'" />
            </div>
        </form>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

Please help !!!

Thanks & Regards

Lalit Narayan

 

 

 

 

 

 

Ianko
Telerik team
 answered on 22 May 2019
3 answers
206 views

Hi, 

I follow https://docs.telerik.com/aspnet-core/getting-started/getting-started this instruction to create a new asp.net core 2.1 mvc project to test Telerik UI for Asp.net Core version 2019.1.220

I installed client resource manually following https://docs.telerik.com/aspnet-core/getting-started/getting-started-copy-client-resources#manual-installation . But the browsers console showed kendo js errors. I was sure I followed the instructions correctly, I don't know why it didn't work. 

I zipped the codes and attached the download url in this thread:

https://celiawestus2.blob.core.windows.net/publics/test/WebApplication1.7z 

Could anyone help to solve this problem?

Ivan Danchev
Telerik team
 answered on 21 May 2019
1 answer
751 views

Does the drop down list tag helper have events?  I can't seem to find documentation anywhere on events.  I want to take action when selected or changed.

<kendo-dropdownlist name="products" filter="FilterType.StartsWith"></kendo-dropdownlist>

 

The examples in the link below only cover the HTML Helper.

https://demos.telerik.com/aspnet-core/dropdownlist/events

Ivan Danchev
Telerik team
 answered on 21 May 2019
7 answers
317 views

Hi, 

I'm trying the Arc Gauge and its not show I'm getting kendoArcGauge is not a function, please see the attached screenshot

Claudia
Top achievements
Rank 1
 answered on 20 May 2019
2 answers
530 views

Hello,

Is there a way to open the toolbar's splitbutton popup to show the items when the splitbutton itself is clicked instead of the little arrow?

Thanks,

Shawn A.

Dimitar
Telerik team
 answered on 20 May 2019
1 answer
1.5K+ views

toolbar.ClientTemplat(string) seems to override all previous toolbar items.

So:

 

.ToolBar(toolbar => {
                        toolbar.Create(); /*toolbar.Save();*/
                        toolbar.Custom().Text("export").IconClass("k-icon k-i-table").HtmlAttributes(new { onclick = "approval_grid_export()" });

                        toolbar.ClientTemplate("etc");

                    })

seems to destroy the toolbar.Create() and toolbar.Custom().

Is there way to just add the ClientTemplate()?

Georgi
Telerik team
 answered on 17 May 2019
1 answer
111 views

Hello,

Is there a way to position the items in a Kendo Toolbar so that some buttons are located on the left-side of the toolbar and some on the right side with empty space between?

Thanks,

Shawn A.

Ianko
Telerik team
 answered on 17 May 2019
4 answers
313 views

Hello,

The column filter icons on my grid are interfering with the column header texts.  Sometimes they are right on top of the texts (see attached).  How do I position these icons so that they are on the bottom right corner of the column header and away from the header text?

Thanks,

Shawn A.

Tsvetomir
Telerik team
 answered on 17 May 2019
1 answer
9.0K+ views

I am trying to get a value and use it to change a label.
All the examples I have found in documentation include only the html helper version
I am using the tag helpers and can’t figure out how to do it.
I tried this:

<script>
         
        function onSelect(e) {
            alert(e.item.Text);
        }
    </script>

<kendo-dropdownlist name="DocumentTypes" on-select="onSelect" for="GovIdTypeID" class="jProfileMod" datatextfield="Name" datavaluefield="Id" bind-to="Model.GovIdTypes" cascade-from="CountryID" cascade-from-field="IssuingCountry.Id"></kendo-dropdownlist>

But it is not working.


John
Top achievements
Rank 1
 answered on 16 May 2019
7 answers
837 views

Hi, Im doing this, but all tools in toolbar are showing? Shouldn't .Clear() do the trick? FYI: Id and body in code below is set from mvc c# variables

@(Html.Kendo().Editor()
                .Name(id)
                .Events(events => events
                    .Keyup(change)
                )
                .Tools(tools => tools.Clear())
                .Value(@<text>
                    @Model.Body
                </text>)
)

 

 

Petar
Telerik team
 answered on 16 May 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?