asked on
Dynamic ASP Classic Form Submit
Hi EE Team,
I am needing some help with a form submit in Classic ASP
http://b.gp.tours/?d=151 - This is the page doing the submission
The problem is the name of each <input type> is a number and it changes for each product/departure.
<input type=radio class=gross name=<%=ProdHero("dep_item_hero")%> value=<%=ProdOption("dep_item_ID")%>>
The reason why is that so a customer can select different option items within the each product, I need to use the 'hero item ID' to define that item type and its options.
In the example above, the Grandstand Ticket has a hero, and if you expand below are the options.
Please let me know if you have anymore questions, I will try the best I can.
TIA!
ASKER
Unfortunately some products may include multiple of similar items, like 2 Hotels required at different parts of the trip (there is a couple which require overnight stays before going to final destination).
Under different Grand Prix's, there can be multiple ticket, hotel, transfer, flight options, and possibly multi of these.
What you you have proposed is what I had in my older website, which works if each product had the same layout (which unfortunately they now do not), I would like it to have a more dynamic hero/option list.
Thank you thou, your input is always great.
Think of it as either buying one product and adding multiple options, or buying multiple products.
Instead of numbers, use names like below where the value is the id of the product
<input type="radio" name="hotel" value="306">
<input type="radio" name="seat" value="152">
<input type="radio" name="race" value="451">
If you are not giving people options as to what seat and hotel, then you are selling packages. In this case, I have created another table called "packages" with an ID, Name and PackagePrice. Then another table called "package_details" with an ID, PackageID and ProductID. Then you can add products to each package. If package 123 is shown, then create your query where package_details.PackageID = 123.
The key is you want to use names that you can accept with variable values and not variable names.
Unfortunately some products may include multiple of similar items, like 2 Hotels required at different parts of the trip (there is a couple which require overnight stays before going to final destination).
I'm thinking as long as dep_item_ID is uniquely defined, we should able to retrieve the Prod Hero ("dep_item_hero") from the backend database, right? So technically we no need to pass Prod Hero ("dep_item_hero") in this case at all.
ASKER
I understand where you are coming from, however I need to have a dynamic name (hero item ID), not static (name).
As mentioned in the previous post to Ryan, it is required for the new website as there maybe multiple of the same type of item, so I would either have a conflict or unable to do a 2nd/3rd/more items that are the same.
ASKER
However, if i have multiple hero's of the same item in the Product, how can i define that?
Reason why I ask this is... Something I want to build in the future is a multiple GP product, where they do 2 or 3 back-to-back(-to-back). so at least 3 hotel heros with options, 2 ticket heros with options, etc.
However, if i have multiple hero's of the same item in the Product, how can i define that?
so.. does it mean, for example, ProdHero "305" is available for multiple Products (Grand Pixes)? or can you elaborate a bit further for this scenario?
sorry, may have lack of understanding to your requirements
there maybe multiple of the same type of item,
You have to think of this as an invoice. You have an invoice header with the invoice id, customer id, and purchase date. Then you have another table of detail that would contain the invoice id and product id. Then a third table for payments that would contain a invoice id, payment type and payment amount at the most basic level.
For the invoice detail, you would end up with duplicate names like
<input name="product" value="213">
<input name="product" value="814">
<input name="product" value="329">
<input name="product" value="111">
On the page this gets posted to, you would look through request.form("product"). I believe it comes through as a csv. like product=213, product=814 etc.
ASKER
After getting alot of feedback from clients who (thankfully) emailed or called me, I always ask them about the website experience.
I want it this way (as I have displayed - hero with expandable), is so most of the work is done for them choosing initially.
In the end you are selling multiple products to one person. However you have it displayed on the front end is separate from the fact you are submitting multiple products. You can have multiple field names duplicated like
<input name="product" value="213">
<input name="product" value="814">
<input name="product" value="329">
<input name="product" value="111">
instead of
<input name="213 " value="213">
<input name="814 " value="814">
<input name="329 " value="329">
<input name="111 " value="111">
On the back end you would know that product id 213 is a hotel and 814 is a seat and so on.
In the end, I am just giving you an idea.
ASKER
For example in a multiple GP product
ID Item Hero/Option
1 Spa Camping Hero
2 Spa Camping Option
3 Spa Camping Option
4 Spa Ticket Hero
5 Spa Ticket Option
6 Spa Ticket Option
7 Spa to Ams Rail Hero
8 Ams Hotel Hero
9 Ams Hotel Option
10 Ams to Zanvoort rail Hero
11 Zandvoort Camping Hero
12 Zandvoort Camping Option
13 Zandvoort Camping Option
14 Zandvoort Ticket Hero
15 Zandvoort Ticket Option
16 Zandvoort Ticket Option
As you can see in this example there will be multiple heros of the same item (Hotels or Tickets or Rail)
Thats where i am unsure if giving a 'word name' to each type will work
ASKER
<input name="213 " value="213">
<input name="814 " value="814">
<input name="329 " value="329">
<input name="111 " value="111">
The name is the Hero ID of each item hero/option, the value is the unique ID of each item selected to be passed.
So If I have the above example, how can it be done?
ASKER
' execute the insert
if problem="" then ' only go if no problem
Dim cmdSurvey
Set cmdSurvey = Server.CreateObject ("ADODB.Command")
cmdSurvey.ActiveConnection = MM_conLLT_STRING
cmdSurvey.CommandText = "INSERT INTO dbo.llt_tSurvey_"&HomeFormID&" ("&theQ&") VALUES ("&theV&")"
cmdSurvey.Prepared = true
do until rsQuestions.eof
cmdSurvey.Parameters.Append cmdSurvey.CreateParameter("param1", 201, 1, rsQuestions.Fields.Item("MaxLength").Value, MM_iif(stripHtml(Request.Form(""&cstr(rsQuestions.Fields.Item("ID").Value)&"")),stripHtml(Request.Form(""&cstr(rsQuestions.Fields.Item("ID").Value)&"")) ,"") ) 'Request.Form(rsQuestions.Fields.Item("ID").Value)
rsQuestions.movenext
Loop
ASKER
Seeing this, does not change how I see this should be done. You have 4 products you are selling. 1) Tickets, 2) Hotel 3) Airport Transfer and 4) Transportation to the track.
Because you are using radio buttons, this suggests that there is one choice. How you physically display these things does not matter. In the end, you have choices for each type of product. And you are getting tripped up by using numbers for the field names. The field names should be either "product" and the value remains. If you submit multiple fields with the same name, it just posts as a csv for class asp.
On the back end, you don't care that value of 305 is a ticket because you should have a table of products that has an id of 305 with a product type of "ticket". So that can be looked up.
Alternatively, you could name the group of tickets, "ticket"
<input type="radio" name="ticket" value="305" checked>
<input type="radio" name="ticket" value="306">
<input type="radio" name="ticket" value="307">
<input type="radio" name="ticket" value="308">
<input type="radio" name="transfer" value="309" checked>
<input type="radio" name="transfer" value="310">
<input type="radio" name="transfer" value="311">
<input type="radio"name="transfer" value="312">
In the example above, you will only get a 2 posted values, one for ticket and one for transfer. So you are just expecting
ticket = request.form("ticket")
transfer = request.form("transfer")
When you start using variable names like you are showing, it is going to get confusing. In the end, all you care about is the value of what is posted because you can look up what "303" is and find it is a ticket for section x.The main point is to use real names that mean something and keep it consistent, not variable.
As far as what you are showing first or what you are calling the hero, that should be in your table to to use product id 303 as the hero for the specific category and then you can show it first and default the field to being checked.
ASKER
this is another reason why I want it to be dynamic and not static
what if I have multiple hotels stays, and/or multiple tickets for multi events
Those are all products. You can add unlimited products.
You should have database tables for Product Categories, Products, Customers, Invoice Header and Invoice details.
When somebody makes a purchase, you start a new Invoice Header row that contains the date and customer id. Then add to the invoice details table using the invoice header id and product id. You can add as many products to the invoice details table as you want.
In your products table, you can have many thousands of products. You may have 20 events. At each event you may have 100 hotels to choose from, 100 types of tickets, and so on.
The fact that you have to use variable field names like this means something is not set up correctly.
As example <input type="radio" class="gross" name="305" value="304">. 304 is probably the product ID. The 305 looks like the product id for the first item or what you are calling the hero. You can call it a number, that is fine, but name="305" is getting inserted to the invoice (or whatever you are naming the sale) as a product.
You also have <input type="radio" class="gross" name="311" value="311" checked="">. Same thing, the name="311" is really referring to the fact this is a product and the value is again probably the product id. All these name="some_number" is really name="product". It would be easier to just use the name for what it is.
When you receive the post, the processing page looks for all the request.form("product") and inserts to your sales invoice. Trying to do this with a variable number for the field name is going to make things confusing.
ASKER
sql = SELECT productID, productName FROM tblProducts WHERE productType ='ticket'
<input type="radio" name="ticket" value="305">ticket 1
<input type="radio" name="ticket" value="306">ticket 2
<input type="radio" name="ticket" value="307">ticket 3
<input type="radio" name="ticket" value="308">ticket 4
or
<input type="radio" name="product" value="305">ticket 1
<input type="radio" name="product" value="306">ticket 2
<input type="radio" name="product" value="307">ticket 3
<input type="radio" name="product" value="308">ticket 4
As far as styling or hiding child rows, you can use nth child https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child to set the first item as the hereo. I don't know your db layout, but perhaps you have a field that designates the item as a hero. Then your sql would be
sql = SELECT productID, productName FROM tblProducts WHERE productType ='ticket' ORDERBY hero DESC
assuming that you have 0's or 1's for hero or not. Or you could use a class like
<input type="radio" name="ticket" value="305">ticket 1
<input type="radio" class="hero" name="ticket" value="306">ticket 2
<input type="radio" name="ticket" value="307">ticket 3
<input type="radio" name="ticket" value="308">ticket 4
Then hide the rows where the class does not equal hero with CSS or javascript.ASKER
So for the hero item, the dep_item_ID and dep_hero_item are the same
For each option, they are different, and the dep_hero_item refers back to the hero it should sit under as an option
So if/when I add 2nd sets of tickets/hotels for a second event, all tickets/hotels are not under the same hero
Maybe post your table layout and a few rows of sample data. Include all tables related to products and sales.
ASKER
The dep_hero_item is important to the code to show the options to the hero.
If it was just a generic word, then all items will be a choice, its Ticket or Hotel, not this ticket and that hotel.
I have just created a page and changed the name to a 'item' to show you what I mean
http://b.gp.tours/home-scott.asp?d=390
Yes, I need the item_ID to pull the data on the submit, but im not understanding how this works.
It will be easier for me to understand what you are doing if I know the database table layout you have for products and sales.
ASKER
userdb - Copy.mdb
So this how it is layed out...
The Pages
categories
-products
--departures
The Items
dep_items
-items
--item_sub
ASKER
<%
If CatID("cat_package")=TRUE Then
Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order")
Else
Set ProdHero=oConnUSR.Execute("SELECT * FROM dep_items WHERE dep_ID="&DepID&" AND dep_item_live=TRUE ORDER BY dep_item_total DESC")
End If
Do Until ProdHero.EOF
ItemCat=ProdHero("dep_item_cat")
If ProdHero("dep_item_hero")=ProdHero("dep_item_ID") Then
ItemID=ProdHero("dep_item_ID")
TitleType="Head"
%>
<tr>
<td width=100 height=80 rowspan=2 align=center valign=bottom><img height=75 src=<%=BrandDir%>/c-<%=ProdHero("item_type")%>.png></td>
<td width=25 height=80 rowspan=2></td>
<td height=60 colspan=12 valign=bottom><b3><%=ItemTitle(ItemCat)%></b3></td>
<td width=50 height=80 align=right rowspan=2><input type=radio class=gross name=item value=<%=ProdHero("dep_item_ID")%> id=<%=ProdHero("dep_item_ID")%> checked></td>
</tr>
<%
TitleType="Sub"
%>
<tr>
<td width=25 height=30></td>
<td height=30 colspan=11 valign=middle><b4><%=ItemTitle(ItemCat)%></b4></td>
</tr>
<%
Set ProdOption=oConnUSR.Execute("SELECT * FROM dep_items WHERE dep_item_live=TRUE AND dep_ID="&DepID&" AND dep_item_hero="&ProdHero("dep_item_ID")&" AND (NOT dep_item_hero=dep_item_ID) ORDER BY dep_item_cat")
If NOT ProdOption.EOF Then
%>
<tr class="parent" id=<%=ProdHero("dep_item_ID")%> style="cursor:pointer;">
<td height=20></td>
<td height=20 align=right><img src=<%=ImagesDir%>/s-dot.png height=20></td>
<td colspan=16 height=20> <b5>Please click here to view alternative options / upgrades</b5></td>
</tr>
<%
ItemCat=0
Do Until ProdOption.EOF
ItemID=ProdOption("dep_item_ID")
ItemCat=ProdOption("dep_item_cat")
TitleType="OptionHead"
%>
<tr class=child-<%=ProdHero("dep_item_ID")%> style="display:none;">
<td width=100 height=30 align=center valign=bottom><img height=45 src=<%=BrandDir%>/c-<%=ProdOption("dep_item_cat")%>.png></td>
<td width=25 height=30></td>
<td height=30 colspan=12 valign=bottom><b4><%=ItemTitle(ItemCat)%></b4></td>
<td width=50 height=50 align=right rowspan=2><input type=radio class=gross name=item value=<%=ProdOption("dep_item_ID")%> id=<%=ProdOption("dep_item_ID")%>></td>
</tr>
<%
TitleType="OptionSub"
%>
<tr class=child-<%=ProdHero("dep_item_ID")%> style="display:none;">
<td width=100 height=20></td>
<td width=25 height=20></td>
<td width=25 height=20></td>
<td height=20 colspan=11 valign=middle><b5><%=ItemTitle(ItemCat)%></b5></td>
</tr>
<%
ProdOption.MoveNext
Loop
End If
Else
TitleType="Head"
%>
<tr>
<td width=100 height=30 align=center valign=bottom><img height=45 src=<%=BrandDir%>/c-<%=ProdHero("dep_item_cat")%>.png></td>
<td width=25 height=30></td>
<td height=30 colspan=10 valign=bottom><b4><%=ItemTitle(DepID)%></b4></td>
<td width=25 height=30></td>
<td width=50 height=50 align=right rowspan=2><%=ProdHero("dep_item_total")%></td>
<td width=50 height=50 align=right rowspan=2>Add</td>
</tr>
<%
TitleType="Sub"
%>
<tr>
<td width=25 height=30></td>
<td height=30 colspan=11 valign=middle><b5><%=ItemTitle(DepID)%></b5></td>
</tr>
<%
End If
ProdHero.MoveNext
Loop
%>
ASKER
Do Until ProdHero.EOF
What is the sql you are using for the recordset ProdHero?Then on line 3
Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order")
I don't see how you are joining the two tables items and dep_items without using criteria to keep it simple, I think I would expect something likeSELECT *
FROM items INNER JOIN dep_items ON items.item_ID = dep_items.item_ID
ORDER BY dep_items.dep_item_order;
In simplified terms, we need
SELECT dep_items.dep_item_hero, dep_items.item_ID
FROM dep_items
ORDER BY dep_items.dep_item_hero;
And that will get us groups to use in your items to show and hide.ASKER
On your last post with code, you have on line 7
Do Until ProdHero.EOF
Then on line 3
Set ProdHero=oConnUSR.Execute("SELECT * FROM items,dep_items WHERE dep_items.item_ID=items.item_ID AND dep_items.dep_ID="&DepID&" AND dep_item_live=TRUE AND dep_item_hero=dep_item_ID ORDER BY dep_item_order")
I am not joining the tables items and dep_items as they are not the same information. dep_items refers to items.
dep_items lists the items available for that specific departure, whereas items is a list of all items available to choose from.
If I simplified it, then I would miss the other information required to display on page. date, price, nights, etc
SELECT items.item_id, dep_items.dep_item_id
FROM items,dep_items;
It looks like you do have some relationships set up in Access.
Table: categories Page: 1
Columns
Name Type Size
cat_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
cat_name Short Text 255
cat_live Yes/No 1
cat_social Short Text 255
cat_package Yes/No 1
cat_other Yes/No 1
cat_description Short Text 255
cat_event Yes/No 1
cat_contact Yes/No 1
cat_subtype Yes/No 1
cat_type Yes/No 1
cat_meals Yes/No 1
cat_type1 Long Integer 4
cat_disclaimer Long Text -
cat_comm Long Integer
Table: dep_item_disc Page: 2
Columns
Name Type Size
disc_ID Long Integer 4
added Date With Time 8
brand_ID Short Text 255
cons_ID Long Integer 4
dep_item_ID Long Integer 4
disc_perc Long Integer 4
disc_gross Long Integer 4
disc_expire Date With Time 8
disc_amount Long Integer 4
disc_curr Short Text 255
disc_live Yes/No 1
Table: dep_item_tax Page: 3
Columns
Name Type Size
tax_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
tax_live Yes/No 1
tax_name Short Text 255
tax_perc Long Integer 4
dep_item_ID Long Integer 4
Table: dep_items Page: 4
Columns
Name Type Size
dep_item_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
dep_item_live Yes/No 1
dep_ID Long Integer 4
item_ID Long Integer 4
item_sub_ID Long Integer 4
dep_item_hero Long Integer 4
dep_item_cat Long Integer 4
dep_item_nights Long Integer 4
dep_item_night Long Integer 4
dep_item_total Long Integer 4
dep_item_curr Short Text 255
dep_item_startdate Date With Time 8
dep_item_mu Long Integer 4
dep_item_comm Long Integer 4
dep_pax Long Integer 4
dep_item_name Short Text 255
dep_item_order Long Integer 4
dep_item_subname Short Text 255
dep_item_soldout Yes/No 1
vendor_ID Long Integer 4
dep_item_total_chd Long Integer 4
dep_alloc Long Integer 4
dep_instp Yes/No 1
Relationships
itemsdep_items
items dep_items
item_ID item_ID
Attributes: Not Enforced, Right Join
RelationshipType: One-To-Many
Table: departures Page: 5
Columns
Name Type Size
dep_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
prod_ID Long Integer 4
cat_ID Long Integer 4
dep_live Yes/No 1
sub_cat_ID Long Integer 4
dep_status Long Integer 4
dep_conf Yes/No 1
dep_name Short Text 255
dep_date Date With Time 8
dep_nights Long Integer 4
dep_social Short Text 255
dep_social_short Short Text 255
dep_social_shortb Short Text 255
dep_sold Yes/No 1
dep_defaultpax Long Integer 4
dep_promo Yes/No 1
dep_promo_hero Yes/No 1
vendor_ID Long Integer 4
api_vendor Long Integer 4
shadow_ID Long Integer 4
api_ID Long Integer 4
loc_ID Short Text 255
Relationships
departuresitineraries
departures itineraries
dep_ID dep_ID
Attributes: Not Enforced
RelationshipType: One-To-Many
productsdepartures
products departures
prod_ID prod_ID
Attributes: Not Enforced
RelationshipType: One-To-Many
Table: item_sub Page: 6
Columns
Name Type Size
item_sub_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
item_sub_live Yes/No 1
item_ID Long Integer 4
item_sub_name Short Text 255
item_sub_description Short Text 255
item_meals Long Integer 4
Table: items Page: 7
Columns
Name Type Size
item_ID Long Integer 4
brand_ID Short Text 255
cons_ID Long Integer 4
item_live Yes/No 1
item_type Long Integer 4
item_name Short Text 255
item_description Long Text -
item_subname Short Text 255
item_zone Short Text 255
item_grade Single 4
added Date With Time 8
item_loc_fr Short Text 255
item_loc_to Short Text 255
vendor_ID Long Integer 4
Relationships
itemsdep_items
items dep_items
item_ID item_ID
Attributes: Not Enforced, Right Join
RelationshipType: One-To-Many
Table: itineraries Page: 8
Columns
Name Type Size
itin_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
dep_ID Long Integer 4
prod_ID Long Integer 4
itin_name Short Text 255
itin_live Yes/No 1
itin_description Long Text -
itin_depdate Date With Time 8
itin_arrdate Date With Time 8
Relationships
departuresitineraries
departures itineraries
dep_ID dep_ID
Attributes: Not Enforced
RelationshipType: One-To-Many
Table: loc_info Page: 9
Columns
Name Type Size
Loc_Info_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
loc_ID Short Text 255
loc_title Short Text 255
loc_info Long Text -
loc_order Long Integer 4
loc_cat Long Integer 4
loc_member Yes/No 1
Table: locations Page: 10
Columns
Name Type Size
loc_ID Short Text 255
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
location_live Yes/No 1
location_name Short Text 255
location_country Short Text 255
location_city Short Text 255
loc_airport Yes/No 1
Table: pax_exp Page: 11
Columns
Name Type Size
exp_ID Long Integer 4
brand_ID Short Text 255
cons_ID Long Integer 4
added Date With Time 8
exp_live Yes/No 1
prod_ID Long Integer 4
prod_plan Long Integer 4
prod_next Long Integer 4
Table: products Page: 12
Columns
Name Type Size
prod_ID Long Integer 4
brand_ID Short Text 255
added Date With Time 8
cons_ID Long Integer 4
prod_live Yes/No 1
prod_name Short Text 255
prod_info Long Text -
prod_short Short Text 7
prod_shortb Short Text 4
cat_ID Long Integer 4
prod_social Short Text 255
loc_ID Short Text 255
Relationships
productsdepartures
products departures
prod_ID prod_ID
Attributes: Not Enforced
RelationshipType: One-To-Many
Table: titles Page: 13
Columns
Name Type Size
title_ID Long Integer 4
added Date With Time 8
brand_ID Short Text 255
con_ID Long Integer 4
title_live Yes/No 1
title_cat Long Integer 4
title_type Short Text 255
title_sub Long Integer 4
title_head Long Integer 4
title_summ Long Integer 4
Table: vendors Page: 14
Columns
Name Type Size
vendor_ID Long Integer 4
added Date With Time 8
cons_ID Long Integer 4
vendor_live Yes/No 1
brand_ID Short Text 255
vendor_name Short Text 255
vendor_loc Short Text 255
vendor_sub_ID Short Text 255
vendor_partner Yes/No 1
From that, how are each of the products (or whatever you are calling them) linked to d=151?
- Malaysia Motorcycle grand prix
- Fri- Sun F Grandstand Ticket
- Option 2
- Option 3
- Option 4
- Empress Hotel
- Transfer from Airport
- Bus to Sepang
ASKER
Currently I am not putting the info into a table yet, I do have a separate Database that has customer details, sales information, however...Once I can get this first information pulling across, I will insert into this.
For your above post, if you look in dep_items, there is dep_ID which references the d=151, then that pulls the item_ID from items table.
SELECT dep_items.dep_item_ID, dep_items.item_ID, items.item_description, items.item_ID
FROM items RIGHT JOIN dep_items ON items.item_ID = dep_items.item_ID
WHERE (((dep_items.item_ID)=151));
For each of the 6 items here, what is the minimal SQL. In other words, I don't want SELECT * FROM table_name. Instead, SELECT field1, field2 FROM table_name It would be at minimum the product id, description and price. TheSQL should relate to d=151 Request.Form(" "&EnqItems("dep_item_hero")&" ")
ASKER
This is what works, it the dynamic selector for each hero product, instead of using names (which I wanted to stay away from)
In case the Prod Hero is important to you and need to be passed during form submission, you could save it as a hidden field for this purpose.
so something like this should work (for me):
hidden field for Prod Hero :
Open in new window
in your looping:
Open in new window