This question is locked. New answers and comments are not allowed.
Hello,
i have the following dropdownlist
The DropDownLost will be filled with Ajax:
I select an item and reload the data. the code in getdata runs again and i select no item. on submit the SelectedAtcCode is set on the value before and the required validator will not run.
how can i reset the value, so that the validator will run?
Regards,
Timo
i have the following dropdownlist
<%= Html.Telerik().DropDownListFor( d => d.SelectedAtcCode ).HtmlAttributes( new { style = "width: 250px;" } ) %>[Required] public string SelectedAtcCode { get; set; }The DropDownLost will be filled with Ajax:
function agentChanged(e) { var atcList = $('#Agent_SelectedAtcCode').data('tDropDownList'); getData('<%= Url.Content("~/Controller/Action") %>', { agent: e.value }, atcList); } function getData(url, params, ctrl) { $.getJSON(url, params, function (data) { if (data.Data) { ctrl.dataBind(data.Data); ctrl.text(""); // ctrl.text(null); ctrl.value(""); // ctrl.value(null); ctrl.open(); } }); }I select an item and reload the data. the code in getdata runs again and i select no item. on submit the SelectedAtcCode is set on the value before and the required validator will not run.
how can i reset the value, so that the validator will run?
Regards,
Timo