If you need an ORDER FORM with conditional formulas in the client-side events
you must read this post.
Previously I was attempting to describe how I needed a form that understood that if Product A (shirts actually) was ordered use shipping rate of $8; if only Product B (decals) was ordered use a rate of $2; if both ordered then use $8 (regardless of quantities).
Below is the logic used and should be able to be applied elsewhere (psst - this can save you $).
Details - this code is applied to the decal amount fields. the 2nd section is changed for the shirts. The 4th section contains the if then logic. It's really important to keep the parenthesis well formed. Dynamic Forms is in desperate need of a Java compiler for error checking.
var numDecal
numDecal=parseInt($(DecalA))+parseInt($(DecalB))+parseInt($(DecalC))
var numShirt
numShirt=parseInt($(LgShirt))+parseInt($(ExLgShirt))+parseInt($(XXLgShirt))+parseInt($(XXXLShirt))
$(TotalDecalHidden) = (numDecal*4.95).toFixed(2)
$(SubTotalHidden) = (parseFloat($(TotalShirtHidden))+parseFloat($(TotalDecalHidden))).toFixed(2)
document.getElementById('SubTotalDecal').innerHTML = 'Decal Subtotal: ' + formatCurrency($(TotalDecalHidden)) + ''
document.getElementById('SubTotal').innerHTML = 'Subtotal: ' + formatCurrency($(SubTotalHidden)) + ''
if (parseInt(numShirt) > parseInt(0))
$(HiddenShippingTotal)=parseFloat(8.00).toFixed(2)
else
if (parseInt(numDecal) > parseInt(0))
$(HiddenShippingTotal)=parseFloat(2.00).toFixed(2)
else
$(HiddenShippingTotal)=parseFloat(0.00).toFixed(2)
document.getElementById('ShippingTotal').innerHTML = 'Shipping Amount: ' + formatCurrency($(HiddenShippingTotal)) + ''
$(GrandTotalHidden)=(parseFloat($(SubTotalHidden)) + parseFloat($(HiddenShippingTotal))).toFixed(2)
document.getElementById('GrandTotal').innerHTML = 'Your Grand Total Comes To: ' + formatCurrency($(GrandTotalHidden)) + ''