jazz__man
asked on
Loop through a RadioButtonList using javascript, in order to validate if a selection has been made.
Hi,
I have a radiobuttonlist which I have to validate using javascript. I know there are a million better ways and easier ways to do this using server side code, however specific to the application I am working on I need to do this in javascript.
Having searched and found many "Solutions" to this problem, I have had none that have worked.
I realy would appreciate some feedback on the easiest way to do this.
All I need to do us check if an item has been selected or not.
Cheers
I have a radiobuttonlist which I have to validate using javascript. I know there are a million better ways and easier ways to do this using server side code, however specific to the application I am working on I need to do this in javascript.
Having searched and found many "Solutions" to this problem, I have had none that have worked.
I realy would appreciate some feedback on the easiest way to do this.
All I need to do us check if an item has been selected or not.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you are talking about counting in Javascript then the "RadioButtonList" dont hold any collection of its items .. you need to get all input type controls and then checking one by one if it is input then is checkbox, if yes then does it contains id of the RadioButtonList if yes then it is an item of the RadioButtonList
..
if you are talking about length in code serverside then you need to check
MyRadioButtonList.Items.Co unt must give you the total intems in the list?
thanks
..
if you are talking about length in code serverside then you need to check
MyRadioButtonList.Items.Co
thanks
ASKER
So the first thing I have to do is count number of buttons on the RadioButtonList.