- This topic is empty.
November 29, 2010 at 4:00 pm #30844
Ive got a collection of forms all with check boxes, its basically a coffee menu with four sections.
Say for example the user selects (clicks check box) a small cappuccino, a latte, and an espresso, how can i get the input names (name+size of coffee) to appear with the value (cost of coffee) in another div so i can then calculate sub-total, add vat etc
So far ive only managed to get the users selections to appear where i want using jQuery serialize, however im having a little trouble picking out the values to carry out calculations on them.
Can anyone suggest an easier / better way for me to approach this?
note : this is a made up project for a fake client and cant involve any server side scripting.November 30, 2010 at 1:47 pm #71689cybershotParticipant
yeh i totally understand that, but this project is for a uni assignment, part one to only use client side technologies, part two is where these are changed out to server side.November 30, 2010 at 3:51 pm #71652TT_MarkMember
Have you tried using JSON? You can set up a multidimensional array of data that stores everything you need, then when the user selects something, simply utilise JQuery to get the appropriate corresponding price etc.November 30, 2010 at 9:23 pm #71657
heres what i currently have, http://www.scottgm.co.uk/test
from here i need to be able to target the users selection to perform calculations for vat, delivery etc.
ThanksDecember 2, 2010 at 8:09 pm #71290
I’ve managed to come up with a solution (im implementing at the moment), it involves separating the huge string of info and converting the cost of the coffees to a float where i can perform the calculations i need (Vat etc), and of course using css to position everything where it needs to be.
Thanks all for the help :)