We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable a disabled dropdownlist based off onchange event

Thread ID:





131523 Jul 14,2017 02:13 PM UTC Jul 17,2017 07:07 AM UTC ASP.NET Core 1
Tags: DropDownList
Jacob Knight
Asked On July 14, 2017 02:13 PM UTC

I have a group of dropdownlists but I'm not utilizing grouping. I've been looking @ the documentation and haven't seen any examples of enabling a ddl as part of the process of selecting from an initial dropdownlist. This is the format I'm using:

        <ej-drop-down-list id="projectsList" width="350px" height="25px" show-rounded-corner="true" watermark-text="Select Project" enable-persistence="true">
            <e-datamanager id="Projects" json="ViewBag.Projects"></e-datamanager>
            <e-drop-down-list-fields text="project" id="id" value="id" />

I'm guessing this can be done with the onchange event & Javascript but just wanted validation or to see if something else is required?

Prince Oliver [Syncfusion]
Replied On July 17, 2017 07:07 AM UTC

Hi Jacob,   
Thank you for contacting Syncfusion Support.   
Yes, we can enable the second dropdownlist when a value is selected in the first dropdownlist using change event. Kindly refer to the following code snippet.   

<div class="col-xs-8 col-sm-4"> 
    <span class="txt">Select Group</span> 
    <ej-drop-down-list id="groupsList" datasource="ViewBag.datasource"  change="onChange" watermark-text="Select"> 
        <e-drop-down-list-fields value="parentId" text="text" /> 
<div class="col-xs-8 col-sm-4" > 
    <span class="txt">Select Country</span> 
    <ej-drop-down-list id="countryList" datasource="ViewBag.datasource1" enabled="false"></ej-drop-down-list> 
<script type="text/javascript"> 
    function onChange() { 
        var ctry = $('#countryList').data("ejDropDownList"); 

If you are looking for a Cascading property, Kindly refer to the following UG link : https://help.syncfusion.com/aspnet-core/dropdownlist/functionalities#cascading 
Kindly refer to the following link for online demo sample: http://aspnetcore.syncfusion.com/dropdownlist/cascading 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon