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

Set Value from JS

Thread ID:





131048 Jun 17,2017 09:02 AM UTC Jun 19,2017 07:18 AM UTC ASP.NET MVC 1
Tags: DropDownList
Ryan Richards
Asked On June 17, 2017 09:02 AM UTC

     I just need to set the value of the dropdownlist via JS. I feel like this should be simple but nothing seems to work. A snippet would be great. 


Keerthana Rajendran [Syncfusion]
Replied On June 19, 2017 07:18 AM UTC

Hi Ryan, 
Thank you for contacting Syncfusion support 
We can use value property directly in MVC to select an item initially. Please refer to the below code snippet 
@Html.EJ().DropDownList("selectCar").TargetID("carsList").ShowCheckbox().EnableRTL(false).Width("150px").Value("Audi A6") 
            <div id="carsList"> 
                    <li>Audi A4</li> 
                    <li>Audi A5</li> 
                    <li>Audi A6</li> 
                    <li>Audi A7</li> 
                    <li>Honda H1</li> 
                    <li>Honda H2</li> 
                    <li>Honda H3</li> 
                    <li>Honda H4</li> 
We can also bind value through JS during DropDownList creation as shown below 
        function oncreate() 
            var ddlobj = $("#selectCar").data("ejDropDownList") 
            ddlobj.option({ value: "Audi A7" }); 
We have prepared sample for your reference. Please refer to the below given link 


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