Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form and recordset values 2

Status
Not open for further replies.

paulatreboot

Technical User
Mar 16, 2005
15
0
0
GB
Hi

i am trying to include the description and dimention in the form values that are sent, i did at one time manage to get the values to go accross but because i am showing 5 records at a time it showed all five dimentions and descriptions for that page

if anyone could help i would be gratefull

thank you

paul edwards (code below)

oh access 2000 and dreamweaver 8 and asp thanks

<form id="products" name="products" method="get" action="cart.asp">
<table width="100%" border="0">
<tr>
<td>Description</td>
<td>Dimentions</td>
<td>Shiplap</td>
<td>Overlap</td>
<td>Treatment</td>
<td>Erect</td>
<td>Cart</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsApex.EOF))
%>
<tr>
<td><%=(rsapex.fields.item("description").value)%></td>
<td><%=(rsapex.fields.item("dimentions").value)%></td>
<td><input type="radio" id="wood"name="wood" value="<%=(rsapex.Fields.Item("shiplap").Value)%>">
&pound; <%=(rsapex.Fields.Item("shiplap").Value)%>.00</td>
<td><input type="radio" id="radio" name="wood" value="<%=(rsapex.Fields.Item("overlap").Value)%>" />
&pound; <%=(rsapex.Fields.Item("overlap").Value)%>.00</td>
<td><input type="radio" id="treatment" name="treatment" value="<%=(rsapex.Fields.Item("treatment").Value)%>">
&pound; <%=(rsapex.Fields.Item("treatment").Value)%>.00</td>
<td><input type="radio" id="erect" name="erect" value="<%=(rsapex.Fields.Item("erect").Value)%>">
&pound; <%=(rsapex.Fields.item("erect").Value)%>.00</td>
<td><input type="submit" value="Add To Cart" /></td>

<%
'strdescription = (rsapex.fields.item("description").value
'response.Write(strdescription)
%>





<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsApex.MoveNext()
Wend

%>

</table>








</form>
 
By the way - it is spelt as dimension not dimention.

How exactly do you want the layout?
Code:
Description
Dimension
row1
row2
...
or
Code:
Description Dimension row 1
                      row 2
                      row 3
where Description and dimension span all the rows? If you want this, then you need to find out how many rows there are first.

What happens if the description and dimension is different for every row or will it always be the same?
 
Hi

on the screen is a table with 6 fields

description dimension shiplap overlap treatment erect cart


then the data is pulled from recordset and shiplap and overlap have the same name radio button on it so that you can only choose one of.

the treatment and erect have different names so you can choose one,none,or both.

that bit is fine, when you submit the form the data gets sent to cart.asp through the method"post".

on this page there is a table the same as above

but i cant find away to send the description and dimension to cart.asp because it is not a radio button it hasnt been selected, so i tried a hidden text type in the form but because i am showing 5 records per page it sends 5 descriptions and 5 dimensions not the one that has been selected on the other radio buttons

sorry i hope this has made it clearer


thanks


Paul....

 
[1] In the page design as shown, I don't see "description" and "demen[red]t[/red]ions" being submitted at all. To make them submitted together with other sets of radio buttons, you have to make them to input element.

[2] To sumit each individual item implemented on each row, you have to contain them in the form of their own.

I suggest you do this for further testing.
[tt]
[green]<!-- taken out
<form id="products" name="products" method="get" action="cart.asp">
-->[/green]
<table width="100%" border="0">
<tr>
<td>Description</td>
<td>Dimentions</td>
<td>Shiplap</td>
<td>Overlap</td>
<td>Treatment</td>
<td>Erect</td>
<td>Cart</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsApex.EOF))
%>
<tr>
[blue]]<!-- inserted -->
<form id="products" name="products" method="get" action="cart.asp">[/blue]
<td>[blue]<input type="text" value="
<%=(rsapex.fields.item("description").value)%>" style="border:none;" readonly="readonly">[/blue]</td>
<td>[blue]<input type="text" value="<%=(rsapex.fields.item("dimentions").value)%>" style="border:none;" readonly="readonly">[/blue]</td>
<td><input type="radio" id="wood"name="wood" value="<%=(rsapex.Fields.Item("shiplap").Value)%>">
&pound; <%=(rsapex.Fields.Item("shiplap").Value)%>.00</td>
<td><input type="radio" id="radio" name="wood" value="<%=(rsapex.Fields.Item("overlap").Value)%>" />
&pound; <%=(rsapex.Fields.Item("overlap").Value)%>.00</td>
<td><input type="radio" id="treatment" name="treatment" value="<%=(rsapex.Fields.Item("treatment").Value)%>">
&pound; <%=(rsapex.Fields.Item("treatment").Value)%>.00</td>
<td><input type="radio" id="erect" name="erect" value="<%=(rsapex.Fields.Item("erect").Value)%>">
&pound; <%=(rsapex.Fields.item("erect").Value)%>.00</td>
<td><input type="submit" value="Add To Cart" /></td>
<%
'strdescription = (rsapex.fields.item("description").value
'response.Write(strdescription)
%>
[blue]<!-- inserted -->[/blue]
[blue]</form>[/blue]
[red]</tr>[/red]
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsApex.MoveNext()
Wend
%>
</table>
[green]<!-- taken out
</form>
-->[/green]
[/tt]
You then would have 5 forms of the same name if 5 items are shown at a time. Each time shopper client on the submit button of certain row, the row data will be submitted including the description and dimen[red]t[/red]ions.
 
Thank You Tsuji

I will try this and get back

Many thanx for your time



Paul....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top