By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

problems to use a redio button

idsanjeev
100+
P: 241
first i want to use link href to click and display its data on next page.
and anther work i want to do selected redio buttons top_id is submetted in another recordset. please help me soon
Expand|Select|Wrap|Line Numbers
  1. <%@ Language =vbscript%>
  2. <% Option Explicit %>
  3. <html>
  4. <head><TITLE>VOICE OF BARAUNIANS</TITLE></head>
  5. <body>
  6. <!--#include file="front.inc"-->
  7. <div style="Position:Absolute; width:700; TOP:0; left:180; background-color:#f0f0f0">
  8. <%
  9. Dim conn
  10. dim objrs
  11. Dim R
  12. Dim R1
  13. Dim vtopsub
  14. dim vtopid
  15. dim vempno
  16. Dim countloop
  17. Dim replycount
  18. Set conn = Server.CreateObject("ADODB.Connection")
  19. conn.Open("DSN=ORACLE; User Id = STARTER; Password = STARTER")
  20. Set R = Server.CreateObject("ADODB.Recordset")
  21. Set R1 = Server.CreateObject("ADODB.Recordset")
  22. Set R = Conn.Execute("SELECT top_id, top_sub, launch_by, launch_dt FROM topmaster order by top_id  ")
  23. %>
  24. <div style="Position:Absolute; top:100; left:0; width:820; height:472; background-color:skyblue">
  25. <table border=0>
  26.   <tr>
  27.     <td align='center' colspan='10%' bgcolor='#f0f0f0'><font face="arial" size=2><b>Top Id</b></font></td>
  28.     <td align='center' colspan='40%' bgcolor='#f0f0f0'><font face="arial" size=2><b>Topic</b></font></td>
  29.     <td align='center' colspan='40%' bgcolor='#f0f0f0'><font face="arial" size=2><b>Employee Name</b></font></td>
  30.     <td align='center' colspan='20%' bgcolor='#f0f0f0'><font face="arial" size=2><b>Posted Date</b></font></td>
  31.     <td align='center' colspan='10%' bgcolor='#f0f0f0'><font face="arial" size=2><b>No.Of Reply</b></font></td>
  32.     <td align='center' colspan='10%' bgcolor='#f0f0f0'><font face="arial" size=2><b>Reply</b></font></td>
  33.   </tr>
  34.   <%R.Movefirst
  35.   countloop = 1
  36.   Do While Not R.EOF%>
  37.     <tr>
  38.       <td align='right' colspan='10%'><font face="arial" size=2><a href=voice.asp><%Response.Write R("top_id")%></a></font></td>
  39.       <td align='left' colspan='40%'><font face="arial" size=2><a href=voice.asp><%Response.Write R("top_sub")%></a></font></td>
  40.       <td align='left' colspan='40%'><font face="arial" size=2><%Response.Write R("launch_by")%></font></td>
  41.       <td align='center' colspan='20%'><font face="arial" size=2><%Response.Write R("launch_dt")%></font></td>
  42.        <%Set R1 = Conn.Execute("SELECT top_id, rep_id from topic where top_id = " & R("top_id"))
  43.       If R1.Recordcount >= 0 Then
  44.         replycount = R1.Recordcount
  45.       else
  46.         replycount = 0
  47.       end if%>
  48.       <td align='center' colspan='10%'><font face="arial" size=2><%Response.Write replycount%></font></td>
  49.       <td>  <input type="radio" name="radio1" value="R("top_id")" checked></td>
  50.    </tr>
  51.     <%countloop = countloop + 1
  52.     If countloop <= 10 Then
  53.       R.Movenext
  54.     Else
  55.       R.Movelast
  56.     End If
  57.   Loop %>
  58.  <%
  59.   R.Find "top_id = '" & Request.Form("top_id") & "'"
  60.   If Not R.EOF Then
  61.      vtopid = Request.Form("top_id")
  62.       Response.Cookies("top_id") = vtopid
  63. end if
  64. %>
  65. </table>
  66. <table width=765>
  67.   <tr>
  68.     <td align='right'><input type="submit" name="submit" value="Reply" onclick="reply()"></td>
  69.   </tr>
  70. </table>
  71.  
  72. </div>
  73. <%conn.close
  74. Set conn = Nothing
  75. %>
  76. <script language="Javascript">
  77. function brvoice()
  78. {
  79.   window.location = "brvoice.asp"
  80. }
  81.  
  82. function reply()
  83. {
  84.   window.location = "voicereply.asp"
  85. }
  86. function voice()
  87. {
  88.   window.location = "voice.asp"
  89. }
  90. function newtopic()
  91. {
  92.   window.location = "newtopic.asp"
  93. }
  94. </script>
  95. </body>
  96. </html>
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript%>
  2. <%Option Explicit%>
  3. <html>
  4. <head>
  5. <title>Barauni Refinery -Voice of baraunians</title>
  6. <!--#include file="front.inc"-->
  7. </head>
  8. <body>
  9. <%If Request.Cookies("userid") = "" Then
  10.   Response.Redirect "login.asp"
  11. Else%>
  12. <div style="Position:Absolute; top:100; left:180; width:820; height:472; background-color:skyblue">
  13. <%
  14. Dim R
  15. Dim R1
  16. dim R2
  17. Dim vrepby
  18. Dim vtopid
  19. Dim vrepid
  20. Dim vrepdt
  21. Dim vreply
  22. Dim errorMsg
  23. Dim conn
  24. dim i
  25. Dim no_of_day
  26. Set conn = Server.Createobject("ADODB.Connection")
  27. conn.Open "DSN=ORACLE; User ID = STARTER; Password = STARTER"
  28. Set R = Server.CreateObject("ADODB.Recordset")
  29. Set R1 = Server.CreateObject("ADODB.Recordset")
  30. Set R2 = Server.CreateObject("ADODB.Recordset")
  31. Set R2 = Conn.Execute("SELECT a.top_id, a.top_sub, a.launch_by, a.launch_dt, a.msg,b.rep_id, b.rep_by, b.rep_dt,  b.reply FROM topmaster a,topic b ")
  32. %>
  33.    <center><b><font face="arial"><h2>POST YOUR REPLY</h2></font></b></center>
  34.     <hr>
  35.     <p>
  36.     <form method="POST" action="voicereply.asp">
  37. <div style="position:absolute; left:300; top:60; z-index:0">
  38. <table border=1 width=250 > <font face="monotype corsiva"><b>Topic</b></center></font>
  39.      <tr>
  40.    <td align='center'>Topic ID</td><td colspan='10%' align='right'><%Response.Write  R2("top_id") %></td>
  41.      </tr>
  42.      <tr>
  43.    <td align='center'>Topic Subject</td><td colspan='10%' align='right'><%Response.Write  R2("top_sub") %></td>
  44.      </tr>
  45.      <tr>
  46.      <td align='center'>Employee Name</td><td colspan='40%' align='right'><%Response.Write R2("launch_by") %></td>
  47.      </tr>   
  48.      <tr>
  49.      <td align='center'>Posted Date</td><td colspan='40%' align='right'><%Response.Write R2("launch_dt")%></td>
  50.      </tr>
  51.      <tr>
  52.      <td align='center' >No.Of Reply</td>
  53.      </tr>
  54. <%end if%>
  55. </table>
  56.  </div>
  57. <% R1.Open "Select top_id from topmaster order by top_id", conn, adOpenStatic, adLockOptimistic, adCmdText
  58.   R.Open "Select rep_id from topic order by rep_id", conn, adOpenStatic, adLockOptimistic, adCmdText
  59.   If R.Recordcount > 0 Then
  60.     R.Movelast
  61.     vrepid = R("rep_id")
  62.     vrepid = CInt(vrepid) + 1
  63.   Else
  64.     vrepid = 1
  65.   End if
Oct 17 '07 #1
Share this Question
Share on Google+
4 Replies


jhardman
Expert 2.5K+
P: 3,405
first i want to use link href to click and display its data on next page.
and anther work i want to do selected redio buttons top_id is submetted in another recordset. please help me soon
Please explain again what your question is. I'm afraid it is not clear what you are asking.

Jared
Oct 18 '07 #2

idsanjeev
100+
P: 241
sir i am creating a page which is display records from table i wants to click on link and display its row detail after searching from table.
another work i wants to do reply on that topic and add its priamry key into anothe table automatically
that my problems
i cant disply specific row data it only disply first or last data from table clicking on any link .
Oct 19 '07 #3

jhardman
Expert 2.5K+
P: 3,405
OK, from what I can see there are a couple holes. 1- the line that generates the radio button should look like this:
Expand|Select|Wrap|Line Numbers
  1.       <td>  <input type="radio" name="radio1" value="<%=R("top_id")%>" checked></td> 
the <%=%> notation is just a shortened notation for <%response.write%>. As you had it written the value passed to the form was "R("

2- On the second page you will need to pull up this info and pass it to the db somehow. Sind you are using a radio button and only one option will be selected, I would do something like this:
Expand|Select|Wrap|Line Numbers
  1. "SELECT * FROM topic WHERE top_id = '" & request.form("radio1") & "'"
I'm not sure I follow everything in your second page, so I hope I'm not steering you wrong, but it should be something along those lines.

Jared
Oct 19 '07 #4

idsanjeev
100+
P: 241
thanks for taking response
plz support enhanced mode at next time
Oct 23 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.