Forum Moderators: open
A snippet of the code is
<input type="checkbox" name="checkbox3" value="<%= (rs_SEAD.Fields.Item("tblProduct_Akhter Code").Value)%>">
I would like tblProduct_Akhter Code displayed in the results page, but also the title and price too. Do i need to modify this code aswell?
Any ideas, thanx
I can send the URL (IP address if required)
<form name="form1" method="post" action="results.asp">
<blockquote>
<% If Not rs_AKHA.EOF Or Not rs_AKHA.BOF Then %>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC" class="maintext">
<td colspan="5" class="subproductheading"><div align="center">Choose
your Processor</div>
</td>
</tr>
<%
While ((Repeat2__numRows <> 0) AND (NOT rs_AKHA.EOF))
%>
<tr class="maintext">
<td width="19%">
<div align="center">
<input type="radio" name="radiobutton" value="<%= (rs_AKHA.Fields.Item("tblProduct_Akhter Code").Value)%>">
</div>
</td>
<td width="8%"><%=(rs_AKHA.Fields.Item("tblProduct_Akhter Code").Value)%></td>
<td width="6%"> </td>
<td width="53%"><%=(rs_AKHA.Fields.Item("Title").Value)%></td>
<td width="13%"><%=(rs_AKHA.Fields.Item("Prem Price").Value)%></td>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_AKHA.MoveNext()
Wend
%>
</table>
<br>
<% End If ' end Not rs_AKHA.EOF Or NOT rs_AKHA.BOF %>
</blockquote>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
The receiving page can read those requests using the "Request" method of ASP:
If a parameter (form field) is called "product", I would get the value as follows:
dim reqProd
reqProd = request("product")
Then I can use the reqProd variable anywhere in my program.
Read up on ASP at www.w3schools.com. Lots of good information there - easy to understand too!
I would also like the title and price too displayed on the results page. At the moment i have just called it from a recordset, do i need to put this in a text field aswell, in order to transfer it across to results.asp?
If so, is there a way to may the text field box look like normal text (hide the box)
thanks
You can hide the text field either with CSS (although this doesn't work in Netscape), or you can simply write the details to the page as you are doing and then have a hidden form field -
<INPUT TYPE="hidden" NAME="Title" VALUE="<%= rs_AKHA.Fields.Item("Title").Value %>">
You can place hidden form fields anywhere on the page and they won't display to the user.
I have rows of :-
[checkbox] Item Code Title Price
(coming from my database via 4 different fields and one table)
I want it so if the checkbox is checked, all the data (Code, title and price) is selected and shown on the results page
(from this i will add up the prices and produce a total etc)
Is it best to capture the product code only, and then use SQL to read the database to retrieve the title and price to be displayed on the results page?
If so what would the SQL look like. (im getting confused)
If you want to see my effort i can email the URL so you get a better understanding of the problem
Or any other ideas please let me know
Make sure you error handle for bad skus, id's and quantities, some knucklehead will try to put in a qty. of "B" sooner or later.
You should always get the price from the database. As far as the title and any other information thats up to you to decide how mission critical it is.
products.asp page contains:-
<input type="checkbox" name="checkbox3" value="<%= (rs_SEAD.Fields.Item("tblProduct_Akhter Code").Value)%>">
Results.asp contains:-
Dim rs_selection__MMColParam
rs_selection__MMColParam = "1"
If (Request.Form("checkbox3") <> "") Then
rs_selection__MMColParam = Request.Form("checkbox3")
End If
rs_selection.Source = "SELECT * FROM [Query - Product Compontent join] WHERE [tblProduct_Akhter Code] = '" + Replace(rs_selection__MMColParam, "'", "''") + "'"
This only works if i select one check box, if i select to or more check boxes no errors appear no results are shown?
Ive have put a reapeat region in using dreamweaver MX, but this did not solve the problem.
Any help?
Thanks