We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45950
    • 40 Posts
    I've gone through everything I can find on db2formit and for the life of me can't figure out how to get it to populate the form fields.

    It writes to the db just fine... it's when i want to edit from the form I'm having problems.

    any assistance would be greatly appreciated...
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How do you get it to work at all in the first place? All I get is
      2014-01-02 06:23:53] (ERROR @ /formit2db/index.php) addPackage called with an invalid package name.
      [2014-01-02 06:23:54] (ERROR @ /formit2db/index.php) addPackage called with an invalid package name.
      [2014-01-02 06:23:54] (ERROR @ /formit2db/index.php) No class specified for loadClass
      


        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
        • 45950
        • 40 Posts
        Well, i know that I had already created the package and all the class and map files first...
        then I have this which includes the hooks and prehooks for Ajaxupload
        [[!Formit?
        &preHooks=`db2FormIt, Formit2AjaxUpload`
        &hooks=`AjaxUpload2Formit, FormIt2db`
        &ajaxuploadFieldname=`poster`
        &ajaxuploadTarget=`images/user/[[!+modx.user.id]]/`
        &ajaxuploadUid=`image`
        &prefix=`dickyh1_`
        &packagename=`campaigns`
        &classname=`campaigns`
        &tablename=`campaigns`
        &redirectTo=`48`
        ]]
        then the FORM.
        I didn't use the &autopackage=`1` cause I had already built everything.

        still having an issue with getting it to put the images where I want it to go via the &ajaxuploadTarget... it writes the path of the images to the db, but they sit in a cache folder.

        anyway... it's taken me all day to get to this point but I have a pretty extensive form so had to write it all by hand cause I couldn't figure out how to formz to do what I wanted it to...
        just can't for the life of me figure out what is required to get it to populate the form for editing once it's written to the DB there is a where reference in the snippet but I can't figure out how to use it
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok, I've never used this before, so I'm trying to figure out how it works so I can figure out why it isn't working wink

          Don't want to hijack your thread, so I'll start my own. [ed. note: sottwell last edited this post 12 years, 9 months ago.]
            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
            • 45950
            • 40 Posts
            Quote from: sottwell at Jan 02, 2014, 12:00 AM
            Ok, I've never used this before, so I'm trying to figure out how it works so I can figure out why it isn't working wink

            Don't want to hijack your thread, so I'll start my own.
            The more the merrier...
            in answer to your other question, I don't think the package name has to be the same as table name and class. When I created the package and ran createxpdoclasses in named everything...
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Well, that's something I've never done. For now, I'll stick to getting a grip on this particular subject. https://forums.modx.com/thread/88387/documentation-for-formit2db
                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