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

Using Javascript select() doesn't seem to work

3 Answers 169 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 30 May 2008, 06:23 AM
Hi

I'm having trouble selecting an item in a combobox using Javascript.

cboAddrCountry.findItemByText('Australia').select();


It seems to find the text okay, however the select() throws back 'undefined' and as such it always points to index zero.

Is there something I'm doing wrong?


Kind regards

Mark Eaton

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 30 May 2008, 08:04 AM
Hello Mark,

I have tried exactly the same thing and it worked as expected. Please examine the attached page and test it.

Is it possible that you do something else in the client-side code, which causes this error?

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mark
Top achievements
Rank 1
answered on 02 Jun 2008, 01:03 AM
Hi Simon

I was doing something just before I selected an item. In the support project you gave me if you were to add the following Javscript line:

    combo.disable();

.. just before ...

    combo.findItemByText("Item2").select();

...it won't work.


I disabled the combobox afterwards it works nicely.


Thanks for you assistance.


Kind regards

Mark Eaton
0
Accepted
Simon
Telerik team
answered on 02 Jun 2008, 03:49 PM
Hello Mark,

Disabling RadComboBox stops it from functioning completely, hence selecting an Item after that will not work.

Try first selecting the Item and then disabling the ComboBox.

Regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Mark
Top achievements
Rank 1
Answers by
Simon
Telerik team
Mark
Top achievements
Rank 1
Share this question
or