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

[Solved] Client Side Validation Combobox

0 Answers 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sandino
Top achievements
Rank 1
Sandino asked on 01 Jan 2013, 10:53 AM
Hi Guys,

I Tried to apply this in my combobox but it doesn't seem to work: http://demos.telerik.com/aspnet-mvc/razor/combobox/clientvalidation
not even the validation message is showing out whenerver i hit save here is my code

View:

@(Html.Telerik().ComboBoxFor(model => model.TransactionCodeId)
                        .AutoFill(true)
                        .BindTo((IEnumerable<SelectListItem>)ViewData["SelectTrxcdList"])
                        //.DataBinding(binding => binding.Ajax().Select("SelectTrxcdList", "blttrx1_"))
                        .Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith))
                        .HighlightFirstMatch(true)
                        .ClientEvents(x => x.OnChange("GetTransDescription"))
                        .Placeholder("Select One...")
                        .SelectedIndex(0)
                        .HtmlAttributes(new { style = "width: 250px" })
                        )
                         @Html.ValidationMessageFor(model => model.TransactionCodeId,"error please")

my model:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
 
namespace Prject.Models
{
    public partial class TransactionsTbl
    {
        [Required]
        public Nullable<int> TransactionCodeId { get; set; }
    }


Hopefull i get as quick response from you guys ive been puzzled with this for 2 days already. Thank You ^^
Tags
General Discussions
Asked by
Sandino
Top achievements
Rank 1
Share this question
or