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.
Unfortunately, activation email could not send to your email. Please try again.

Manually Set Focus

Thread ID:

Created:

Updated:

Platform:

Replies:

123975 May 4,2016 11:34 AM May 5,2016 05:57 AM ASP.NET MVC 1
loading
Tags: DropDownList
Matthew Shakespeare
Asked On May 4, 2016 11:34 AM

Is there a way to manually set focus on a MVC DropDownLIst in Javascirpt , similar to standard 

$( "#target" ).focus();


Keerthana Rajendran [Syncfusion]
Replied On May 5, 2016 05:57 AM

Hi Matthew,    
Thank you for contacting Syncfusion support,   
 Yes, we can set focus to DropDownList by setting focus() method to the wrapper element of Dropdown.    
 <code>   
<div class="control" style="floatleft;">   
            <span class="txt">Select Group</span>   
           @Html.EJ().DropDownList("groupsList").Datasource((IEnumerable<groups>)ViewBag.datasource)   
        </div>   
</code>   
  
To set Focus on creation:   
 <code>   
<script>   
   
    $("#groupsList").ejDropDownList({   
        create:function(){ $("#groupsList_wrapper").focus();},   
        });   
       
</script>   
</code>   
 Please refer the below link for DropDownList client side API’s:   


 
We have also set focus to DropDownList in our online demos sample using shortcut key.   
 Please refer the below given link:   
 Please let us know if you have any concern.    
Regards,   
Keerthana.   


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.

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.

;