check box

Reply

Join Date: Dec 2004
Posts: 27
Reputation: faisyshah is an unknown quantity at this point 
Solved Threads: 0
faisyshah faisyshah is offline Offline
Light Poster

check box

 
0
  #1
Mar 16th, 2005
hello every body

i have a form that will have multiple check boxes on it . and i have 20 machinery for sale. thereform i have 20 checkboxes in my form.
all the checkboxes have different value but checkboxes name will be same.
my requirement is that when a customer want to purchase 1 or 2 or 3 or 4
machinery from out of 20 machinery.now custmer click on checkboxes if a custmer click 10 checkbox or want to purchase 10 machinery then all 10 machinery submit in database.i think for this purpose i need loop. may be for loop, while loop.

how i can do this (code in item.asp)

<TR>
<TD>Product Name</TD>
<TD>
<input type="checkbox" name="givenname" value="vacuum">
</TD>
</TR>
<TR>
<TD>Product Name</TD>
<TD>
<input type="checkbox" name="givenname" value="sandbox">
</TD>
</TR>


(code in additem.asp)

rsUsers("givenname") = Request.Form("givenname")
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 131
Reputation: william_stam is an unknown quantity at this point 
Solved Threads: 2
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

Re: check box

 
0
  #2
Mar 18th, 2005
you are in luck i had the same problem, until yesterday. I found this article and modified the code to, instead of deleteing the records it shows them (http://www.webthang.co.uk/tuts/tuts_dmx/rob3/rob3.asp).

insted of
cDelete.CommandText = "DELETE FROM tblTemp WHERE tblTemp.RecordID IN (" & sDelete & ")"

change to
cDelete.CommandText = "Select * FROM tblTemp WHERE tblTemp.RecordID IN (" & sDelete & ")"

remove
Response.Redirect("delete.asp")

and loop like any other recordset

hope it helps!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 27
Reputation: faisyshah is an unknown quantity at this point 
Solved Threads: 0
faisyshah faisyshah is offline Offline
Light Poster

Re: check box

 
0
  #3
Mar 19th, 2005
sir first i want to submit data in my order table.
for example i have three tables in my database
customer table
item table
order table
when customer want to purchase some machinery first he enter information about himself. customer information will submit in customer table.
then he want to purchase some machinery
the order table consist of (for example)
order id(primery key)(auto generate)
customer id (foreign key)
product name

i mean three columns in order table

for that purpose iam using a form which consist of 20 checkboxes
the name of all check boxes will be same but values will be different
for example
one checkbox name is product but value will be sandbox (sandbox is the name of machinery)
other check box name is product but value will be different(vacuum tube is the name of machinery)
similarly 20 chekboxes in my form
machinery name and checkbox value will be same
now when customer want to purchahe one or more machinery then customer click on check box now checkboxes values will be submit in database.
(note) customer can give order for 10 or more machinery the please please pleae tell me how order will be submit in order table from checkbox to order table.
please describe me in detail
can u describe complete code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC