3 Replies Latest reply on May 24, 2006 10:22 AM by dempster

    Dynamic Validation with Calculations

    hml398 Level 1
      I have fairly complex matrix for calculating dues for a membership application. I want to be able to calculate the total dues as the user selects the various pieces of the membership which I would normally do with Javascript. However, the value of each checkbox varies based on which other checkboxes are selected. I could just submit the form to set the various values but it seems to be a poor user-interface to have this form keep refreshing each time they select something.

      Basically they pick the company membership type which can be "overall" or "overall, region" or "overall, region, chapter" or "region" or "chapter". They can belong to more than one region or chapter. Some regions require an overall membership, some don't. Then they pick the various people to be associate members - they are limited to so many free ones and then they have to pay. The people can have the various types as well. The more regions and chapters they pick, they more they pay. A bit complex. Any suggestions on how to do this?

        • 1. Re: Dynamic Validation with Calculations
          Dan Bracuk Level 5
          With javascript. Display your running total in a disabled text box.
          • 2. Re: Dynamic Validation with Calculations
            hml398 Level 1
            Thanks for the reply but it really doesn't answer my question. I know to use Javascript but I have never had to change the values that javascript was using (that I have to pull from a database since they change each year.
            • 3. Re: Dynamic Validation with Calculations
              dempster Level 1
              Maybe this is a question for a JavaScript forum???

              What you describe is possible with JavaScript. There are ways to determine which boxes are checked and assign values accordingly. ColdFusion can pull values from your database and assign them to JavaScript variables and arrays, which are then used in your calculations.

              If this is too complex, perhaps you should consider a multipart form. Have them make some initial selections, submit the form, and then present the next set of appropriate options based on the previous part. It sounds like this "complex matrix" could be pretty confusing for the users as well, so it might work better in parts.