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

[Solved] how to find the text and value of combox which is in a usercontrol.

1 Answer 137 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
abhay
Top achievements
Rank 1
abhay asked on 22 Apr 2009, 10:32 AM
Hi,

i have a usercontrol which contain comboboxes.I have a page which uses master page and also that user control.So how can i find the text and value of combobox.


i have written

 

 

 

var dbMedication =

 

 

document.getElementById(

'<%=MedicationControl.FindControl("RadComboBoxMedication").ClientID%>').get_text();//it shows error get_text method not  found.


RadComboBoxMedication is id of combo box.


MedicationControl is usercontrol.

Plz help me.

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Apr 2009, 11:13 AM
Hello Abhay,

Try the following code for accessing the RadComboBoxwhich is placed inside a user control.

[JavaScript]
 
<script type="text/javascript">  
function getCombo()  
{  
    var combo = $find('<%=MedicationControl.FindControl("RadComboBoxMedication").ClientID %>'); // Access the combo  
    alert(combo.get_text());  //Get the ext of RadCombo  
}  
</script> 

Thanks,
Princy.
Tags
ComboBox
Asked by
abhay
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or