[thelist] newbie alert! Question about .asp

Janet Nabring-Stager jnabring at yahoo.com
Fri Apr 20 10:52:02 CDT 2001


I'm attempting to develop and improve my .asp skills at work, so I'm
creating an online cookbook of sorts.
In the following code, the user chooses the recipes they want to view
by checking the checkbox next to the recipe.  As you can probably
tell from the code, I'm attempting to assign the checkbox the value
of the recipe name in the database:
<form name="form1" method="post" action="search_names_results.asp">
  <p>Check on the box next to the recipe name to view a recipe:</p>
  <p> 
    <%
Dim strName
strName = "NAME"
While Not objRS.EOF 
If objRS("Category") = strCategory Then
	Response.Write "<INPUT TYPE=CHECKBOX VALUE=" & objRS("Name") &
"NAME=" & strName & ">" & objRS("Name") & "<P>"
End If
ObjRS.MoveNext
Wend

ObjRS.Close
Set objRS = Nothing	
%>
    <input type="submit" name="Submit" value="Show Recipes">

This is working and I'm very happy!
However, I want the user to be able to click in the checkboxes of the
recipes they want to view and then hit the button and have those
recipes print out.  I'm having troubles!  How do I refer to the Value
of a checkbox?  Is there anything else in this code that is amiss?

<%
Dim objConn, objRS, intCount

Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=d:\Inetpub\wwwroot\connections\InformationServices\CHS_Cookbook_Files\CHS_Cookbook.mdb;"
objRS.Open "tblRecipe", objConn, adOpenStatic, adLockOptimistic,
adCmdTable

For intCount = 1 to Request.Querystring("NAME").Count
			If objRS("Name") = Request.Form("Value") Then
			Response.Write objRS("Name") & "<BR>" & objRS("Source") & "<P>" 
			End If
Next

objRS.Close
Set objRS = Nothing	
%>

I apologize for the length of this message and if I'm asking too
specific a question here-please just let me know (nicely, if
possible) if I'm violating any list rules...
TIA-

=====
Janet Nabring-Stager
http://www10.ewebcity.com/jnabring

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




More information about the thelist mailing list