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

How to get selected value at client side on button press

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Imtiaz
Top achievements
Rank 1
Imtiaz asked on 04 Aug 2008, 06:21 PM
Hi

I have created a user control using RadCombo. There are several instances of the control on the same page. User can select single value from each drop down and hit a button. Requirement is that atlease one of the combo box value should be selected before postback. How can I check it in Javascript on click of submit button?

Thanks
Imtiaz

1 Answer, 1 is accepted

Sort by
0
Imtiaz
Top achievements
Rank 1
answered on 04 Aug 2008, 10:02 PM
Since my requirement was just to check if anything is selcted or not, this code fixed my issue. Please let me know if anyone sees any issue with this approach?

var comoSelected =0;  
        for(var i=0; i<Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++)  
        {  
            if(Telerik.Web.UI.RadComboBox.ComboBoxes[i]._selectedIndex !=null)  
            {  
                comoSelected++;  
                break;  
             }  
        }    


Thanks

Tags
General Discussions
Asked by
Imtiaz
Top achievements
Rank 1
Answers by
Imtiaz
Top achievements
Rank 1
Share this question
or