1

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

SilverLight
  • 19,668
  • 65
  • 192
  • 300
  • Are you using an UpdatePanel, the Telerik update thing, or just a normal full-page postback? – Nick Craver Feb 08 '10 at 13:49
  • yes , i am using an update panel around this combo box ... i used OnSelectedIndexChanged event because of another combo box... imagine my combo boxes like country and city choose when user select a country form a combo box so another combo box shows citis – SilverLight Feb 08 '10 at 18:41

1 Answers1

1

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.

karim79
  • 339,989
  • 67
  • 413
  • 406