We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi there, I've been using FormItBuilder without much problem until I've wanted to start adding data to a table.

    I have carefully followed http://bobsguides.com/custom-db-tables.html tutorial and set up the package and table required.

    However, I've hit a stumbling block in the following code from the FormItBuilder documentation:

    //Demo Table Mapping (Allows auto entry of data into an mysql Table (xPDO object)
    $o_form->setDatabaseObjectForInsert('tableClass',array(
        array($o_name,'name'),
        array($o_address,'address'),
        array($o_country,'country'),           
    ));


    I have amended as follows:

    $o_form->setDatabaseObjectForInsert('table_name',array(
        array($o_name,'name'),
        array($o_email,'email'),
        array($o_mobile,'mobile'),           
    ));


    Changing the tableClass to the table name - but I don't think this is correct. Have tried various other parameters but without success and need to get this resolved.

    I'm sure its quite straightforward, but its a pretty big leap for me! smiley
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 37246
      • 128 Posts
      have you tried http://modx.com/extras/package/formsave? I just found it and DUDE... it's awesome, and just 2 mods to your formit call too!
        I LOVE MODX! | greyskymedia.com
        • 37042
        • 384 Posts
        Plus 1 for FormSave. Works great. Very little tweaking.
          ...
        • Thanks eladnova and Grey Sky Media for the FormSave suggestion, funnily enough I have come across this a couple of days ago, however, it stores IP addresses which I was under the impression with current EU Cookie Law you are required to seek permission from submitter to access such data.

          I managed to sort my issue not with FormItBuilder but directly using FormIt and the blog post from http://blog.kingori.co/2012/02/how-to-save-formit-data-to-db-in-modx/

          Having said all that I do like the functionality the FormSave offers, however, it would be good to remove some of the default fields.
            Helen Warner
            Number one pixel!
            Proud to be linked with MODX at Crimson Pixel
            • 10165
            • 129 Posts
            Quote from: boomerang at Feb 12, 2013, 01:24 PM
            Thanks eladnova and Grey Sky Media for the FormSave suggestion, funnily enough I have come across this a couple of days ago, however, it stores IP addresses which I was under the impression with current EU Cookie Law you are required to seek permission from submitter to access such data.

            I managed to sort my issue not with FormItBuilder but directly using FormIt and the blog post from http://blog.kingori.co/2012/02/how-to-save-formit-data-to-db-in-modx/

            Having said all that I do like the functionality the FormSave offers, however, it would be good to remove some of the default fields.

            Hi boomerang, the blog link doesn't seem to work now, I wonder if you might be able to give me an example of how you got this working - I'm having the same issue with Formitbuilder

            many thanks
            • freshwaterwest - I'm just putting a blog post of my own together which will have the info as it looks as if http://kingori.co has changed his website. Will post link shortly.

              UPDATE: Here's my version which is based on the blog originally written by King'Ori and with info from http://www.bobsguides.com.

              http://www.crimsonpixel.co.uk/blog/2013/07/29/modx-formit-to-custom-database-table/ [ed. note: boomerang last edited this post 10 years, 9 months ago.]
                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel