top button
Flag Notify
Site Registration

How to validate the radiobutton in asp in JavaScript File?

+1 vote
220 views

I have two radio button both are unchecked. When I select a button, it will alert select one radiobutton..
After selection of the radiobutton that radio button should be unchecked....

posted Oct 14, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Not able to understand can you update the issue step by step so that someone can look into it?

1 Answer

0 votes
function selectRadioButton()
{

var y=document.getElementById("ctl00_ContentPlaceHolder1_rbyes");
var n=document.getElementById("ctl00_ContentPlaceHolder1_rbno");


if(y.checked==false && n.checked==false)
{
alert(Please select Yes/No");
return false;
}
return true;
}

<asp:RadioButton  runat="server" ID="rbyes" Text="Yes"  visible="true" GroupName="a"  />
 <asp:RadioButton  runat="server" ID="rbno" Text="No" visible="true" GroupName="a" />
 <asp:Button  ID="btnOk" runat="server" Text="OK" OnClick="btnOk_Click"  OnClientClick="return selectRadioButton();"/>
answer Nov 15, 2014 by Manikandan J
Similar Questions
+1 vote

This example shows you how to check given input contains only numbers (digits) or not using regular expression in asp.net and c#.

Regular expression
string strRegexpNumber = @"^[0-9 ]*$";

+2 votes

I want to check the availability of sitemap.xml and robot.txt file on hosted server and I'm working on SEO project where user put URL and in return the availability of these two file will Show Some Message . Please give me some example

...