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. Image for the cookie policy date
close icon

set focus to specific dropdownlist on page laod

Dear,

I have a page with three dropdownlists. How can I set the focus to one specific dropdownlist?


this is one of my dropdownlists:
<ejs-combobox id="newProduct"
              dataSource="@ViewBag.products"
              allowFiltering="true"
              filtering="onfiltering">
    <e-combobox-fields value="Id" text="Name"></e-combobox-fields>
</ejs-combobox>

calling 
        window.onload = function () {
    $("#newProduct").focus();
 
}

is not working

thanks


1 Reply

NP Narayanasamy Panneer Selvam Syncfusion Team September 4, 2019 01:29 PM UTC

Hi Koen,

 
We have validated your query. 
 
Based on your code snippet. we have prepared the sample and its working fine in our end. We suspect that you did not refer the jquery file in Layout.cshtml.  
If so please refer the below cdn in head section 
 
 
If we misunderstood your requirement please get back us with further details like, 
1.       Issue reproducing video. 
2.       Issue reproducing sample. 
 
Regards, 
Narayanasamy P. 


Loader.
Live Chat Icon For mobile
Up arrow icon