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

getting selected value of combobox from other combobox clientside

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Taeho Yoo
Top achievements
Rank 1
Taeho Yoo asked on 17 Sep 2008, 02:37 AM
Hi,

I have two radcomboBoxs in my page.
I would like to compare the selected value in the first combo with the second combo selected value.
What I did is 

<

script language="javascript" type="text/javascript">

var firstCombo = <%=srcStudyMinLengthSelector.ClientID%>;
function SecondComboHandleEndChanging(sender, eventarqs) {
sender.get_text(); // this is the second combo selected value
alert(firstCombo .value);  // this returns the first combo selected text not value
alert(firstCombo .text);     // undefined
alert(firstCombo .get_value());  // javascript error 'no method'
}

</

script>

Your help would be appreciated,

Toby

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 17 Sep 2008, 07:39 AM
Hi Taeho,

I suggest that you edit the code by the following way:

<script language="javascript" type="text/javascript">   
var firstCombo = $find("<%=srcStudyMinLengthSelector.ClientID%>");  
function SecondComboHandleEndChanging(sender, eventarqs)   
{  
     alert(firstCombo.get_text());       
     alert(firstCombo.get_value());   
}   
</script> 

You can aslo find our help topic useful.

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Taeho Yoo
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or