We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37859
    • 34 Posts
    Until now I just used FormIt to make a contactform, but I got a question to make a rather different form, but I don't know if and how this can be done in FormIt.

    I will try to explain what I need to do :

    People can make reservations for books. They can choose more than one book.
    In the form they must insert the amount of each book they want and then there must be a value change in that line of the form where the total price changes for that bookamount.

    For example, this could in the form :
    Book-1 field1_for_amount x Price1 = Total1 (amount x price1 field)
    Book-2 field2_for_amount x Price2 = Total2 (amount x price2 field)
    ...
    You reserved books for a total amount of GrandTotal (Total1 + Total2 + ...)

    Then the person must recieve an email with details of what books and how many of them he reserved, and what the costs wil be.
    It looks like some shopping cart form, but is not intended for shopping online, only to make reservations.
    I hope my question is clear.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You might want to look into something like http://simplecartjs.org/

      http://www.sepiariver.ca/blog/modx-web/super-simple-simplecartjs-for-modx/

      You can easily have a snippet to email the checkout data using the SendForm method. http://simplecartjs.org/documentation/sendform-checkout
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 44580
        • 189 Posts
        If I understand what you want to do, the answer is yes, it can be done. I did something similar with Formit where I had a quote form that adjusted the total price dynamically based on selections in the form. This information was then saved to the database in custom tables and then Migx was used to view/ manipulate the data. Javascript was used on the form to do the dynamic updating. Emails were sent to both the customer and the Admin for follow-up.

        It ended up working really well, but it was not easy to set up.
          • 3749
          • 24,544 Posts
          Doing that with FormIt alone is theoretically possible, but using JavaScript (I usually use JQuery) to update the total field would be much easier, and would provide a much better experience for the user, imo.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 47401
            • 295 Posts
            I agree with Bobray. all you need to do is create the forms as you see fit, incorporating jquery. input forms can be multidimensional array for multiple options etc... you could even use MIGX to create the forms from the database side of modx.

            so in theory you have

            database side to keep form fields
            front end side using bootstrap/jquery form input types etc...
            and formit to process the form, captchure data and send it to an email address or create your own hook and send it to 3rd party using Curl etc.,. lots of ways you could go with this smiley
              • 47401
              • 295 Posts
              as for the calculations, passing the data to a bespoke hook would allow you to calculate this using php