asp.net mvc 3 - Auto complete Shouldn't take new value as a value -
i using autocomplete contacts , contacts can suggested based user enter text these suggests come elastic search.if contact not within system ,autocomplete shouldnot take value autocomplete,it should not take or raise error. how handle scenario. using knockout kendo.
in .cshtml page code :
<div class="people-tags"> <input id="notecontacts" class="display-inline form-control tagsinput-info-round" data-bind="value:contactfullnames, valueupdate: 'afterkeydown'" /> </div>
in .js file :
selfnote.contactfullnames = ko.computed({ read: function () { var contactfullnames = ""; if (selfnote.contacts() != null) { $.each(selfnote.contacts(), function (index, value) { console.log(value); if (contactfullnames != null && contactfullnames != "") contactfullnames = contactfullnames + "," + value.fullname; else contactfullnames = contactfullnames + value.fullname; }); } return contactfullnames; console.log(contactfullnames); }, write: function (newvalue) { console.log("full name" + newvalue); }, owner: });
Comments
Post a Comment