Вопрос

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();
        $("#txtID").focus();            
}
}

Any help will be appreciated.

Это было полезно?

Решение 2

$("#txtID").show(400, function() {
    $(this).focus();
});

Другие советы

Try this it can be work:

$('#txtID').show('slow', function() {
 $(this).focus();
});

Reference

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top