Click here to Skip to main content
15,665,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am the beginner of asp.net using c# . .

In my project i used one gridview control with Input(Radio). If I select 1 radio then click select(Its a button).then selected radio button details are display the following textboxes. then i can modify it and store it..

My problem is suppose the user if doesn't choose the radio button, he directly click the select button without choosing a radio button in grid view the error will be occur .

Then my qustion is how to set validation for that button click.

Plz help me.. i don't know.. dis s correct or wrong..

By
Rosy..

[edit]Subject, tags only - OriginalGriff[/edit]
Posted
Updated 4-May-12 21:06pm
v2
Comments
Sandeep Mewara 5-May-12 2:39am    
Where is this select button? In grid row or outside grid?
OriginalGriff 5-May-12 3:06am    
Changed question title to meaningful description. Please do not use "Peace be upon u guys" or similar as it does not tell potential answerers what your problem is - that wastes time if they (in this case) know nothing about threading. If you use a more descriptive title, you will get better focussed responses.
JilRose 7-May-12 1:16am    
outside grid

set one of them as by default selected radio button
 
Share this answer
 
You can use javascript function to check

C#
function GetRadioButtonValue(id)
{
    var radio = document.getElementsByName(id);
    for (var j = 0; j < radio.length; j++)
    {
        if (radio[j].checked)
            alert(radio[j].value);
    }
}
 
Share this answer
 
Comments
JilRose 5-May-12 10:03am    
Thank you guys..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900