Hi all,
I'm looking for some help on a form I've been building. The form lists the items and their description a visitor can select from a "Session" the visitor picks from a separate page. The visitor can select (via combo box) the quantity of each item and each item has a specific price, which I am drawing from a table on our database with SQL. As-is, I'm using client side javascript close to that used in Demo 20 to total the prices of the items.
However, one function of my form has created a few roadblocks for me. The number of items offered for any given Session might vary. I have 20 possible item fields that can be filled and currently, I've set up question events to hide the excess fields if the number of items offered for a Session is less than 20. (10 items will show 10 fields, 15 shows 15, etc.) I've had to wrestle with the client side javascript, as I was using the 'Quantity' combo box as part of the javascript, but once one of the fields are hidden, the javascript is broken since the hidden Quantity boxes essentially don't exist.
I did find a workaround by having the Quantity boxes pass their amounts to hidden fields, then using the hidden fields in the javascript instead.
So here's the issue I'm having (apologies for the lengthy explanation, I didn't want to leave out anything important):
The javascript works perfectly fine: Quantity combo boxes are passing their values to hidden quantity fields; those hidden quantity fields are multiplied by the hidden price fields for each item and then added up. The only problem I have is that the text/html field I have with the total now does not update. If I have the hidden quantity fields changed to text boxes and I click on the text box once the combo box has passed the value to it, the total updates -- but if I only click on and change the combo boxes, the total doesn't update.
I've tried adding onclick, onblur, onchange and a few other event objects to the shortnames of both the Quantity combo boxes and the Quantity hidden fields, but this doesn't seem to work. Am I missing something, or is there another way to go about this? Everything works except for updating the total in the Text/html field.
Some guidance would be greatly appreciated!
Thanks in advance,
Kate S.