C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




radio button validation on server side


Posted Date: 28 Aug 2008      Total Responses: 3

Posted By: smitha chakravarthy       Member Level: Bronze     Points: 1


hi...im using asp2.0 with c#..
i have 2 radiobuttons male/female....
i aam having a page in which i need to validate the columns...
<tr>
<td style="width:50%;" align="left" valign="middle"><asp:Label runat="server" ID="XGender" Text="Gender"></asp:Label></td>
<td style="width:50%;" align="left" valign="middle">
<asp:RadioButton ID="RadioButtonMale" runat="server" Text="M" GroupName="Gender" />
<asp:RadioButton ID="RadioButtonFemale" runat="server" Text="F" GroupName="Gender" />
now how to validate the radiobutton without using javascript....
tnks
smitha




Responses

Author: vipul    28 Aug 2008Member Level: DiamondRating:     Points: 3
hi,
for that you do one thing you give any one as checked = true so always one readio button is checked so no need to validate the readio button


vipul,
http://dongavipul.blogspot.com


Author: Athira Appukuttan    28 Aug 2008Member Level: DiamondRating:     Points: 4
Hi..

function Validation()
{
if(document.getElementbyId('RadioButtonMale').value=="")
{
else if(document.getelement('RadioButtonFemale').value=="")
{
alert("Atlest one should be select");
return false;
}
}
}


<asp:button id="btn" runat="server" onClientclick="return Validation();"/>



Author: Deepa    28 Aug 2008Member Level: DiamondRating:     Points: 2
Hi there.
u can also use radiobuttonlist instead of two different radio buttons
and u can use validation control.

Regards,
Deepa.


Post Reply
You must Sign In to post a response.
Next : Treeview Auto Compressing Prob
Previous : Attach Database
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

budget conference call

Contact Us    Privacy Policy    Terms Of Use