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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Getting dropdownlist object in javascript to call its methods

Thread ID:

Created:

Updated:

Platform:

Replies:

147350 Sep 6,2019 04:20 PM UTC Sep 9,2019 10:10 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: Dropdown List
John Stephen Mangam
Asked On September 6, 2019 04:20 PM UTC

Hi,

I'm not able to get the dropdownlist object and call its methods.

 var dropdownList = document.getElementById("DMDropDownList");
dropdownList.selectItemByValue('@Model.DMId.ToString()');

Please let me know where I'm going wrong.

Thank you.

Ashokkumar Balasubramanian [Syncfusion]
Replied On September 9, 2019 10:10 AM UTC

Hi John Stephen Mangam, 
 
Greetings from Syncfusion support. 
 
Could you please refer the below code block for create the instance in EJ2 components? 
  
var dropdownList = document.getElementById("DMDropDownList").ej2_instances[0]; 
 
 
Also, we don’t have the selectItemByValue method in our EJ2 Dropdown List component. But you can achieve this requirement by using value property of Dropdown List, please refer the below API documentation. 
 
 
Please let us know, if you have any concern on this. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon