This is a migrated thread and some comments may be shown as answers.

[Solved] How to set focus to textbox on Onchange event of dropdown?

0 Answers 12 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nancy
Top achievements
Rank 1
Nancy asked on 12 Apr 2013, 05:45 AM
Hello,

I have textbox whose visibility is controlled by value selected in telerik dropdown. Say if value selected is yes then textbox is visible else it hides. Now when value in dropdown set to Yes i am not able to set focus to that textbox. Only on pressing 'Tab' key focus moves over there but not as soon as textbox appears. I have tried this code:

function OnDropDownChange(e){
if ($(this).val() === "Y") {
            $("#
txtID").show();
            document.getElementById("
txttxtID").focus();             
}
}

or using $("txtID").focus(); doesn't set focus.
Any help will be appreciated.
Tags
ComboBox
Asked by
Nancy
Top achievements
Rank 1
Share this question
or