March 13th, 2012, 10:53 PM
Help w/ Categorized Loop Iteration
I am not sure why I am having problems with this but I am. I have a web page that displays a menu for a Japanese restaurant as seen here - Menu
As you can see the menu is broken up into categories, such as Appetizers, Carpaccio, etc.
I have a recordset that I am looping through and I have been able to code it to output a category header when the category changes. What I am trying to do is wrap the whole thing in a div. I don't have a problem putting in the opening div tag (w/ the header of course), but it is the closing div tag that is troubling me.
Here is my code
Do Until rs.eof
If varx <> rs("cat_id") Then
response.write "<h3 class='category_title'>" & rs("category") & "</h3>" & vbcrlf
If rs("description") <> "" Then
response.write "<p class='category_desc'>" & rs("description") & "</p>" & vbcrlf
varx = rs("cat_id")
response.write "<div class='menu_item'>" & vbcrlf
response.write "<h3><span>" & rs("Item_Name") & "</span></h3>" & vbcrlf
if rs("Item_Desc") <> "" Then
response.write "<p>" & rs("Item_Desc") & "</p>" & vbcrlf
response.write "</div>" & vbcrlf
response.write "<div class='menu_item_price'>6.5</div>" & vbcrlf & vbcrlf
Last edited by thall89553; March 14th, 2012 at 12:30 AM.
Today the world, tomorrow the universe...