html5 - kendo UI DropDownList behaves weird -


i have following code. when fetching value selected, works fine. if try put selected value in condition, falters. code crashes.

var onacctmgrselect = function (e) {     // access selected item via e.item (jquery object)     ddamlist = $("#ddam").data("kendodropdownlist");     if (ddamlist.value() == "0")         $("#btnsearch").attr("class", "k-button  k-state-disabled");     else         $("#btnsearch").attr("class", "k-button");     ///alert(ddamlist.text());      checkvaliddata(); }; 

dropdownlist code below:

function loadaccountmanagers() {     $("#ddam").kendodropdownlist({         change: onacctmgrselect,         datatextfield: "acctmgrfullname",         datavaluefield: "id",         datasource: {                 schema: {                     data: "d", // svc services return json in following format { "d": <result> }. specify how result.                     total: "count",                     model: { // define model of data source. required validation , property types.                         id: "id",                             fields: {                                 id: { validation: { required: true }, type: "int" },                                     acctmgrfullname: { type: "string", validation: { required: true} }                                     }                            }                         },                 transport: {                 read: {                     url: "../services/prospects.svc/getaccountmanagers", //specify url data should return records. read method of products.svc service.                     contenttype: "application/json; charset=utf-8", // tells web service serialize json                     type: "get" //use http post request default not allowed svc                 }             }         }     }); 

i'm trying disable submit button if first item selected (which blank item in case value of '0').

am going wrong anywhere? please help!


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -