1 Reply Latest reply on Jan 7, 2010 8:41 AM by MartinBrändle

    HOWTO Making webform for general use (with calculated fields)

    qryn

      Title

      HOWTO Making webform for general use (with calculated fields)

      Your post

      Hello everybody,

       

      this is a bit of a general question but I just do not know where to start... I work with FM 10 pro and FM server 10.

       

      Now I want to create a calculating orderform which anyone can approach online without logging on like IWP. Is this possible with a Filemaker layout which is laidout as a form?

      Maybe I make it in filemaker and then use the PHP assistent? Do these calculatingfield still work then? Hopefully someone can give me a suggestion how to make the best start.

       

       

      This form looks something like this:

       

      -------

      name: [........]

      more ID info:[........].......

       

      [.....] (insert quatity) x poster 20x28cm - price 12,50 = [.............] (calculated field= price x quantity)

      [.....] (insert quatity) x poster 13x18cm - price 6,00 = [.............] (calculated field= price x quantity)

      [.....] (insert quatity) x poster 6x9cm - price 6,00 = [.............] (calculated field= price x quantity)

      [.....] (insert quatity) x poster 30x40cm - price 9,00 = [.............] (calculated field= price x quantity)

      [.....] (insert quatity) x poster 20x28cm - price 12,50 = [.............] (calculated field= price x quantity)

       

      Total         [.........] (SUM of all above calculated fields.)

       

      {Send} button       {Clear} button

       

      ----------

       

      Kind Regards Krijn

       

        • 1. Re: HOWTO Making webform for general use (with calculated fields)
          MartinBrändle
            

          I think you have to do that client-side with JavaScript. Retrieve the prices and store them in a JavaScript array. In the form fields, you have to use the onchange event handler to call the Javascript calculation function which updates the price and the total.

           

          If you wanted to have the database update the calculated values, you would anyway need to send the form values forth and back, for which you need JavaScript (AJAX code) as well. But this would mean that you already create a new record in the order table or in an intermediate order table. You probably prefer to have the order record only created after the user has completed the whole form.