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

Getting selected value on page load

1 Answer 128 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Blop
Top achievements
Rank 1
Blop asked on 30 Apr 2012, 03:51 PM
Hi, for 2 hours now I'm trying to get a selected value on page load...
I'm using jquery and I ve read every page about radcombox on client-side...

here's what I do.
Some one to tell me what's wrong?
Thanx

  $j(document).ready(function() {
      var combo = getElem("<%= myCombobox.ClientID %>");
      var item = combo.get_selectedItem();
      var val = item.get_value();
//code...
});

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 01 May 2012, 11:19 AM
Hello,

When the document ready event is fired the client side object of the RadComboBox is not yet initialized, this is why the pageLoad event should be used instead. Also the $find function should be used to obtain a references to the client-side object of the control.

Kind regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Blop
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or