Active Server Pages Programming (ASP)/radiobutton query

Advertisement


Question
hey please help me out.. how to get a value from  radiobutton in asp. suppose we have 2 radio button and we want to give a if else statement by their clicking like if radio...="sumthing"then.....
thwn what is the syntax for that? like what is written after if ......= like...i hope u understand..i mean what is writtne radio.value or what ? i am new to asp..



thanks in advance

Answer
Hi

This is what you need to do


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript">

function clickCheck(sval) {
    document.getElementById("RBValue").value = sval;
}

</script>
<style type="text/css"></style>
</head>
<body>
<input type=hidden name="RBValue" />
<input type="radio" onClick="clickCheck('expired')" name="Radio1" />Expired<br />
<input type="radio" onClick="clickCheck('notexpired')" name="Radio2" />Not Expired

</body>
</html>


If you get the RBValue in post you should get "expired" or "notexpired", take necessary action which one to display.

Cheers

-Srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.