472,352 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

checkboxes in asp page

i have many checkboxes and i can check as many as i want.
when i click submit i should see the products checked and calculate their total price.
this is my code:

Produit2.asp:
<%@LANGUAGE="VBSCRIPT"%>
<%
Set produitsXML =Server.CreateObject("Microsoft.XMLDOM")
produitsXML.load(Server.MapPath("Produit.xml"))
Set produits= produitsXML.documentElement
nbproduits=produits.childNodes.length
for j=0 to nbproduits-1
Set produit=produits.childNodes.item(j)
nump=produit.childNodes.item(0).text
nomp=produit.childNodes.item(1).text
prixp=produit.childNodes.item(2).text
%>
<html>
<head>
<Script LANGUAGE="JAVASCRIPT">
function memochoix(j){
document.formesaisie.choix.value=j;
}
</Script>
</head>
<body>
<table border='1'>
<tr><td><input type="checkbox" onClick=memochoix(<%=j%>)>
nom:<%=nomp%> prix:<%=prixp%>
</td>
</tr>
<%next%>
</table>
<form name="formesaisie" action="chercherProduit.asp" method=post>
<input type="hidden" name="choix">

<input type="submit">
</form>
</body>
</html>


chercherProduit.asp:
<%@LANGUAGE="VBSCRIPT"%>
<%vchoix=Request.form("choix")
Set produitsXML=Server.CreateObject("Microsoft.XMLDOM" )
produitsXML.load(Server.MapPath("Produit.xml"))
Set produits=produitsXML.documentElement
Set produit=produits.childNodes.item(vchoix)
nump=produit.childNodes.item(0).text
nomp=produit.childNodes.item(1).text
prixp=produit.childNodes.item(2).text
%>
<html>
<body>le produit choisi est:<%=nump%> nom:<%=nomp%> prix:<%=prixp%>
</body>
</html>

Produit.xml:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<?stylesheet type="text/xsl" href="Produit.xsl"?>
<!DOCTYPE produits [
<!ELEMENT produits (produit*)>
<!ELEMENT produit (nump,nomp,prixp)>
<!ELEMENT nump (#PCDATA)>
<!ELEMENT nomp (#PCDATA)>
<!ELEMENT prixp (#PCDATA)>
]>
<produits>
<produit>
<nump>key</nump>
<nomp>keyboard</nomp>
<prixp>20</prixp>
</produit>
<produit>
<nump>scr</nump>
<nomp>screen</nomp>
<prixp>80</prixp>
</produit>
<produit>
<nump>web</nump>
<nomp>webcam</nomp>
<prixp>40</prixp>
</produit>
<produit>
<nump>usb</nump>
<nomp>usb</nomp>
<prixp>30</prixp>
</produit>
<produit>
<nump>rou</nump>
<nomp>router</nomp>
<prixp>60</prixp>
</produit>
<produit>
<nump>mou</nump>
<nomp>mouse</nomp>
<prixp>15</prixp>
</produit>
<produit>
<nump>spe</nump>
<nomp>speaker</nomp>
<prixp>30</prixp>
</produit>
</produits>



the problem is that i just can see the last checkbox checked when i click submit but what i want is to see all the products i have chosen and to calculate their total price.
thank u.

--------------------------------------------------------------------------------
May 4 '07 #1
0 1089

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is...
4
by: Pete | last post by:
Okay, I'm still stuck with this problem. Here's a quick recap/summary :- 1. Page 1:User checks 3 out of 10 checkboxes and submits form to page 2...
8
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form....
1
by: SC G | last post by:
Hi, I use a web application that has 120 checkboxes on it for me to select from before I submit a form. I have to select boxes in groups of 40...
3
by: Jaime Stuardo | last post by:
Hi all... I'm trying to use a custom validator for a group of checkboxes in order to validate that at least 1 checkbox is checked before...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all...
4
by: jeet | last post by:
Plz help me.Problem is that On the first page I display all other user with checkbox and give user option to select only two user which he wants to...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check"...
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI...
7
by: viki1967 | last post by:
I need one function javascript that: 1) when I enter in this htm page I see enabled only checkbox of categories A, M and T; checkboxes of...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.