I have a radio button i want it to bind with database field
when i click on the radio button it will call the value n get displayed all data in textbox given.
how to do it

Recommended Answers

All 3 Replies

Can you clarify your question please?

Hi,

Attached is the code.

find the attachment and shoot out ur queries.:)

gud day

bye

0 then lobjconn.ConnectionString= "provider=sqloledb;server=ravigopal;initial catalog=expense;integrated security=true" lobjconn.open lobjcmd.activeconnection=lobjconn lobjcmd.commandtype=1 lobjcmd.commandtext="select text1 from country where id=" + lstrid lobjcmd.execute() lobjconn.closeend if%>function fnsubmit(optid){ document.form1.method="post"; document.form1.action="sample.asp?id="+optid; document.form1.submit();} 0 then lobjconn.ConnectionString= "provider=sqloledb;server=ravigopal;initial catalog=expense;integrated security=true" lobjconn.open lobjcmd.activeconnection=lobjconn lobjcmd.commandtype=1 lobjcmd.commandtext="select text1 from country where id=" + lstrid lobjcmd.execute() lobjconn.closeend if%>function fnsubmit(optid){ document.form1.method="post"; document.form1.action="sample.asp?id="+optid; document.form1.submit();}

Here is an example using Northwind.

<%

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "provider=sqloledb;server=xx.xx.xx.xx;initial catalog=northwind;user id=xx;password=xx;"
Set objRSCategories = Server.CreateObject("ADODB.Recordset")

lstrid=Request("catid")
%>
<html>
<head>
</head>
<body>
<form id="form1" name="form1" method="get">
<%
objConn.Open
categoryQuery="SELECT [CategoryID] FROM [Northwind].[dbo].[Categories] "

objRSCategories.Open categoryQuery, objConn

Do Until objRSCategories.EOF = True
    catid=objRSCategories("CategoryID")
    %>
    <input type="radio" name="catid" id="rd1" value="<%= catid %>" onclick="this.form.submit();"><%= catid %><br>
    <%
    objRSCategories.MoveNext
Loop

If Len(lstrid) > 0 then
    descQuery="SELECT [Description] FROM [Northwind].[dbo].[Categories] where CategoryID=" & lstrid
    Set objRSDesc = Server.CreateObject("ADODB.Recordset")

    objRSDesc.Open descQuery, objConn
    desc = ""
    Do Until objRSDesc.EOF = True
        desc = desc & objRSDesc("Description")
        objRSDesc.MoveNext
    Loop
    %>
    <textarea name="t1" cols="10" rows="5"><%= desc %></textarea>
    <%
End If

objConn.close

%>
</form>    
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.