Search code examples
c#asp.netjavascriptjqueryradcombobox

DropDownList + OnSelectedIndexChanged + AutoPostBack=False


is it possible to force dropdown list to fire OnSelectedIndexChanged event without AutoPostBack=True?

i told that because i have some RadComboBoxes(telerik) In My Form

i am controling their focus with JQuery

such as this code when my form loads:

<script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('input[id$=RadcbCoNameInInsert_Input]').focus();

</script>

so when AutoPostBack=True and OnSelectedIndexChanged fires after it's code telerik skin acts and finally i lost my radcombobox focus ... i mean that radcombobox skin code is against my jquery code ...

how can i force radcombo box to focus after it's postback or how can i disable it's autopostback to keep my focus on radcombobox?

(i am so amateur about jquery.)

best regards


Solution

  • Invoking focus() directly on a jQuery object simply invokes the onfocus (focus) event handler. You must invoke focus on the DOM elements instead, to get the browser to focus on it:

    $('input[id$=RadcbCoNameInInsert_Input]').get().focus();
    

    See http://api.jquery.com/get/ for accessing the underlying DOM elements.