Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 28th, 2005, 8:57 AM   #1
batch
Newbie
 
Join Date: May 2005
Posts: 3
Rep Power: 0 batch is on a distinguished road
Multiple posts- checkboxes

Hey there firstly this is what I am trying to acheive:
Page 1: Html Form choose pizza size and quantity
Page 2: choose toppings
Page3: cost and details
I have done page 1 and i can make that go to a php that shows what you have selected but i need help with being able to then choose toppings using multiple check boxes and then be able to go to the final page 3 with total cost and details. Thnx in Advance from Batch
batch is offline   Reply With Quote
Old May 28th, 2005, 12:14 PM   #2
medamaybe
Newbie
 
Join Date: May 2005
Location: the netherlands
Posts: 11
Rep Power: 0 medamaybe is on a distinguished road
maybe you could show us what you've done so far, that might help us to help you
medamaybe is offline   Reply With Quote
Old May 29th, 2005, 10:17 AM   #3
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
use checkboxes as opposed to radio buttons. i don't see the problem here.
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old May 29th, 2005, 11:51 AM   #4
batch
Newbie
 
Join Date: May 2005
Posts: 3
Rep Power: 0 batch is on a distinguished road
Page 1- <form action="toppings.php" method="POST">

<table border="1">
<tr>
<td>What size pizza?</td>
</tr>
<tr>
<td><INPUT TYPE=RADIO NAME="pizzasize" VALUE="0.99">Small-£0.99</td>
</tr>
<tr>
<td><INPUT TYPE=RADIO NAME="pizzasize" VALUE="1.99">Medium-£1.99</td>
</tr>
<tr>
<td><INPUT TYPE=RADIO NAME="pizzasize" VALUE="2.99">Large-£2.99</td>

</tr>
<tr>
<td>Quantity <INPUT TYPE=TEXT NAME="quantity" SIZE="3"></td>
</tr>
<tr>
<td><input type="submit" value="Toppings"/></td>
</tr>
</table>

</form>
Page 2- <h4><u>Cost so far..."</u></h4>
Pizza Cost £ <?php echo $_POST["pizzasize"]?><br />
Quantity: <?php echo $_POST["quantity"]?><br /><br />

Total Cost: £0<br>
<hr>
<h3><u>Toppings.</u></h3>

<br>
<b>Meat toppings...</b>
<br>
<form action="cost.php" method="POST">
<input type="checkbox" name="toppings[]" value="chicken">Chicken<br>
<input type="checkbox" name="toppings[]" value="beef">Beef<br>
<input type="checkbox" name="toppings[]" value="ham">Ham<br>
<input type="checkbox" name="toppings[]" value="pepperoni">Pepperoni<br>
<input type="checkbox" name="toppings[]" value="spicy pork">Spicey Pork<br>
<input type="checkbox" name="toppings[]" value="spicy chicken">Spicey Chicken
<br>

<b>Vegetable Toppings...</b>
<br>
<input type="checkbox" name="toppings[]" value="red pepper">Red Pepper<br>
<input type="checkbox" name="toppings[]" value="mushroom">Mushroom<br>
<input type="checkbox" name="toppings[]" value="chilies">Chilies<br>
<input type="checkbox" name="toppings[]" value="green pepper">Green Pepper<br>
<input type="checkbox" name="toppings[]" value="red onions">Red Onions<br>
<input type="checkbox" name="toppings[]" value="tomato chunks">Tomato Chunks<br>
<input type="checkbox" name="toppings[]" value="sweetcorn">Sweetcorn<br>

<b>
<input type="submit" value="Order"/>
</form>
Page 3- <h4><u>Cost</u></h4>
<p>
Your Order has been sucessfully sent here is what you have ordered:

Pizza Cost £ <?php echo $_POST["pizzasize"]?><br />
Quantity: <?php echo $_POST["quantity"]?><br /><br />
Toppings: <?php echo $_POST["quantity"]?><br /><br />

I need help with making this final page work any suggestions would be useful
batch is offline   Reply With Quote
Old May 29th, 2005, 11:53 AM   #5
batch
Newbie
 
Join Date: May 2005
Posts: 3
Rep Power: 0 batch is on a distinguished road
to bl00dninja i am trying to make all of the checkboxes be viewed on the third page Thnx again
batch is offline   Reply With Quote
Old May 29th, 2005, 3:34 PM   #6
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
Inside the <input> tag put CHECKED or possibly SELECTED and it will show up already checked. Now you have to check that varibles to make sure it needs a check first but that isn't to hard.

Hope that works for ya!
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC