I'm trying to create a shopping cart system that integrates with an existing Point of Sale system. Due to that reason, I'm some what limited in the flexibilty I have with the data I receive. That being said, here's the question:
Each item/product is loaded into my viewprd.asp page. Then, I load the item's modifiers into a table and display them, sorting them by Modifier Type. (i.e. Product=Hamburger,Modifier
ngs, Modifier=Mustard, Pickles, etc.) In some cases only a maximum number of modifiers may be selected for any given Modifier Type. In other cases, there are up-charges for adding an item (add fries for $1.50).
You can see an example of what I'm talking about at http://www.joandjoes.com/viewprd.asp
Because of the way I need to process the form, the value for the Modifier checkboxes has to be the ModifierID (i.e. ModifierID 4103 = Pickles). This means that any onClick action would need to refer to a hidden value that contains the price value.
Here is the code for one of my checkboxes (actually, its the code for all of the check boxes, since it loops through):
This works with an external .js script that makes sure the correct number of options are selected.
I also have <input type="hidden" name="HMod1<%=t%>" value="<%=AddCost%>"> which contains the modifier price.
I need to return this value onclick to another .js script. The line for that script is onclick="this.form.total.v
I guess in short, lol, is there any way to both check to see if the required number of check boxes have been selected while at the same time submitting a value from a hidden field in order to provide a dynamic item total?
I hope this isn't too confusing.
Thanks for your help