6 Answers, 1 is accepted
0
Hello Adnrej,
Could you elaborate a bit more about the scenario you are trying to achieve? Do you mean to implement a validation if there are no items checked in RadComboBox?
Regards,
Nencho
the Telerik team
Could you elaborate a bit more about the scenario you are trying to achieve? Do you mean to implement a validation if there are no items checked in RadComboBox?
Regards,
Nencho
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.
0
berto
Top achievements
Rank 1
answered on 20 Aug 2012, 01:58 PM
Yes, this is exactly what I need. I have to be sure that at least one item will be checked.
0
Hello Andrzej,
In order to implement the desirable validation, you could perform a verification if there are any items checked with the client method get_checkedItems of the RadComboBox object, or you could check if the CheckedItems.Count is greater than 0 at server side. Please consider the following approach implemented at client side, at the event handler of an RadButton, considering there are two RadComboBoxes to validate:
All the best,
Nencho
the Telerik team
In order to implement the desirable validation, you could perform a verification if there are any items checked with the client method get_checkedItems of the RadComboBox object, or you could check if the CheckedItems.Count is greater than 0 at server side. Please consider the following approach implemented at client side, at the event handler of an RadButton, considering there are two RadComboBoxes to validate:
function
onClientClicked() {
var
noErrors =
true
;
var
label = document.getElementById(
"label"
);
for
(i = 0; i < 2; i++) {
if
(Telerik.Web.UI.RadComboBox.ComboBoxes[i].get_checkedItems().length < 1) {
noErrors =
false
;
}
}
if
(!noErrors)
label.textContent =
"Fill all RadComboBoxes"
;
else
label.textContent =
""
;
}
All the best,
Nencho
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.
0
Matt
Top achievements
Rank 1
answered on 24 Jul 2013, 06:55 PM
I'm trying to use JQuery to get the value of a specific checkbox but I can't find any documentation for get_checkedItems() for a RadComboBox anywhere.
Could you post a working link to it??
Could you post a working link to it??
0
A2H
Top achievements
Rank 1
answered on 24 Jul 2013, 08:46 PM
Hello,
Please use the below code to find checked items of combobox in client side
For reference please check the below link
1) ClientSide Basics
2) RadComboBox Object
Thanks,
A2H
Please use the below code to find checked items of combobox in client side
var
$ = $telerik.$;
function
validate(sender, eventArgs)
{
var
combo = $find(
"<%= RadComboBox3.ClientID %>"
);
if
(combo.get_checkedItems().length < 1) {
alert(
"Please select atleast one item"
);
}
}
For reference please check the below link
1) ClientSide Basics
2) RadComboBox Object
Thanks,
A2H
0
A2H
Top achievements
Rank 1
answered on 24 Jul 2013, 08:49 PM
Hello,
Please use the below code snippet to find the checked items in combobox on client side
Please refer this link for reference
Thanks,
A2H
Please use the below code snippet to find the checked items in combobox on client side
var
$ = $telerik.$;
function
validate(sender, eventArgs) {
var
combo = $find(
"<%= RadComboBox3.ClientID %>"
);
if
(combo.get_checkedItems().length < 1) {
alert(
"Please select atleast one item"
);
}
}
Please refer this link for reference
Thanks,
A2H