Active Server Pages Programming (ASP)/ASP radio button query

Advertisement


Question
hey..see this coding.
<form name="frmSearch" method="post" runat="server">
<div   name="div1" id="div1"><font size='3'>                 
                      Destinations for PIN: <%=request("pin") %>
</font></div>
<table border="1" cellpadding="2" cellspacing="0" align="left" style="width: 656px">
 <tr bgcolor="#C0C0C0" >
   <td  colspan="4" align="center">Search by CLI: </td>
 </tr>
 <tr>
     <td bgColor=#f5f5f5 align=left>CLI:</td>
       <td  bgColor=#f5f5f5 align=left nowrap >
         <input type=text name=txtcli id=txtPin />             
         <input type="submit" name="btnCli" value="Get Destinations"  style="font-size:7pt; font-family: Verdana; padding:0px; margin:0px; background:#D7D4F0">
       </td>
       <td bgColor=#f5f5f5 align=left> <form action="http://172.16.18.13/servicerest/expiredestination.php?action=getdestsandcli&cli=("cli")&"&pin="&request.QueryString("pin")&"view="&request.QueryString("ëxpired") >
<input type="radio" name="radiobutton1" value="expired"> Expired    
<input type="radio" name="radiobutton1" value="not expired"> Not Expired

</form>
       </td>  
       
       
 </tr>
</table>
</form>

<%
if request.Form("btnCli")<>"" then
response.Redirect "/TAMS/Customer_Service/Search/viewDestinations.asp?opt=cli&cli="&request("txtcli")&"&pin="&request("pin")
end if
%>


i have to show http://172.16.18.13/servicerest/expiredestination2.php?action=getdestsandcli&cli  on the click of expire radiobutton and other one link to sshow on clicking " not expired" radio button...what should i do..and same button to be used i.e get destinations to show the data..please help me out..i am new to asp

Answer
hi

you can create a hidden variable, on clicking of radio button, create a javascript method on click of radio button you can call the javascript function.  In the javascript function update the value of which button is clicked onto hidden variable.

In the form pass hidden variable and which will have necessary value and figure which one to display.

Happy programming

-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.