asp.net - How to write the radcombobox selectedindexchange event in javascript? -
i don't know how write javascript function in radcombobox selectedindexchange.
asp.net
<tr> <td> <asp:label runat="server" id="label73" cssclass="labels" text="call response"></asp:label> </td> <td> <telerik:radcombobox runat="server" skin="metro" id="cbocallresponse" autopostback="true" emptymessage="select call response" zindex="100001"> <items> <telerik:radcomboboxitem value="attended" text="attended" /> <telerik:radcomboboxitem value="noanswer" text="noanswer" /> <telerik:radcomboboxitem value="callbacklater" text="callbacklater" /> <telerik:radcomboboxitem value="number not exists" text="number not exists" /> <telerik:radcomboboxitem value="wrong number" text="wrong number" /> </items> </telerik:radcombobox> <span class="warning">*</span> <asp:requiredfieldvalidator id="requiredfieldvalidator8" runat="server" cssclass="warning" text="select call response" controltovalidate="cbocallresponse" validationgroup="callvalidate"></asp:requiredfieldvalidator> </td> </tr>
vb.net
private sub cbocallresponse_selectedindexchanged(byval sender object, byval e telerik.web.ui.radcomboboxselectedindexchangedeventargs) handles cbocallresponse.selectedindexchanged if cbocallresponse.selectedvalue = "callbacklater" pnlschedule.visible = true popwindow(radcalllog) else popwindow(radcalllog) end if end sub
i want write down javascript function selectedindexchange because every selectedindex postback.
i'm not sure popupwindow here solution is
<telerik:radcombobox runat="server" onclientselectedindexchanged="cl_indexchange" skin="metro" id="cbocallresponse" autopostback="true" emptymessage="select call response" zindex="100001"> <items> <telerik:radcomboboxitem value="attended" text="attended" /> <telerik:radcomboboxitem value="noanswer" text="noanswer" /> <telerik:radcomboboxitem value="callbacklater" text="callbacklater" /> <telerik:radcomboboxitem value="number not exists" text="number not exists" /> <telerik:radcomboboxitem value="wrong number" text="wrong number" /> </items> </telerik:radcombobox>
into <script>
tag
<script language="javascript" type="text/javascript"> function cl_indexchange(sender, eventargs) { var pnl = document.getelementbyid("pnlschedule"); var item = eventargs.get_item(); if ( item.get_text() == "callbacklater") pnl.style.display="none"; else //if make visible //pnl.style.display="block"; .... } </script>
hope helps
Comments
Post a Comment