We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31621
    • 23 Posts
    I tried with an empty prefix as well, but get the same message. Is the Prefix required?
      • 3749
      • 24,544 Posts
      Quote from: vishalashah at Apr 04, 2011, 07:26 PM

      I tried with an empty prefix as well, but get the same message. Is the Prefix required?

      I’m not sure if it’s required, but you should really have one to distinguish your table(s) from the MODX tables with the modx_ prefix. The _modx prefix is assumed if there’s no prefix.
        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
        • 31621
        • 23 Posts
        Thanks a ton! My issue is resolved.

        - I created a table with a prefix: dcvsborg_members
        - Deleted all folders created for the schema under core/components
        - Tried to submit data and it worked.
          • 3749
          • 24,544 Posts
          I’m glad you got it working. Thanks for reporting back. smiley
            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
            • 31621
            • 23 Posts
            Hi,

            formit2db worked just fine for me based on the above messages. However, when I try to do the same on another page, it writes a blank entry in the DB.

            Below is the code that writes the blank entry. Would anyone know why?

            [[!FormIt? 
            &hooks=`spam,formit2db,email,redirect` 
            &preHooks=`db2formit`
            &prefix=`dcvsborg_`
            &packageName=`vsbmdiEvents`
            &tablename=`eventscalendar`
            &emailTpl=`eventsEmailTpl` 
            &emailTo=`####@####.com`
            &emailSubject=`[[+title]]`
            &redirectTo=`12`]]
            <p>[[+fi.error.error_message]]</p>
            <form class="form" action="[[~[[*id]]]]" method="post">
                <input name="nospam:blank" type="hidden" />
                <input name="resource_id" type="hidden" value="[[+fi.id]]" />
                
            <label for="title">
                    Title [[+fi.error.title]]
                </label>
                <input id="title" name="title:required" type="text" value="[[+fi.title]]" />
            
            <br/>
            <label for="startdate">
                    From Date [[+fi.error.startdate]]
                    
                </label>
                <input id="startdate" name="startdate:required:isDate=`%m/%d/%Y`" type="text" value="[[+fi.startdate]]" /> 
            <br/>
            <label for="starttime">
                    From Time [[+fi.error.starttime]]
                    
                </label>
                <input id="starttime" name="starttime:required" type="text" value="[[+fi.starttime]]" />
            <br/>
            <label for="enddate">
                    To Date [[+fi.error.enddate]]
                    
                </label>
                <input id="enddate" name="enddate:required:isDate=`%m/%d/%Y`" type="text" value="[[+fi.enddate]]" />
                <br/>
                <label for="endtime">
                    To Time [[+fi.error.endtime]]
                    
                </label>
                <input id="endtime" name="endtime:required" type="text" value="[[+fi.endtime]]" />
            <br/>
                <label for="address">
                    Location [[+fi.error.address]]
                    
                </label>
                <textarea id="address" name="address:required" type="text" value="[[+fi.address]]" rows="5" cols="54"></textarea>
            <br/>
                <label for="description">
                    Description [[+fi.error.description]]
                    
                </label>
                <textarea id="description" name="description:required" type="text" value="[[+fi.description]]" rows="10" cols="54"></textarea>
            <br class="clearBoth" />
            <div class="form-buttons">
                    <input type="submit" value="Create" />
            <input type="reset" value="Clear" />
                </div>
            <br class="clearBoth" />
            </form>
              • 31677
              • 5 Posts
              Hello,

              I am a newbe at this, I am experimenting with this snippet. Overall it works verry nice, thanks Bruno good job.
              vishalashah, maybe trie it without redirect, I noticed that it doesn’t work with properly with it. Maybe that’s the case.

              Does someone know how to delte an entry with this method?
                • 31621
                • 23 Posts
                Thanks Vivalarevo.

                The issue was that the MySql column names did not match the case with my calls from the snippet. After I matched the cases, it worked fine.

                Another thing, I would mention is, that FormIt latest version has changed support for validation calls from inline to the snippet call. The inline support will be valid only till Formit 2.0.
                  • 31677
                  • 5 Posts
                  Thank you for your reply.
                  So you did get it working with "redirect", when I trie it then it stays on the page same page. Do you aor someone else have an idea what the the problem could be. If take out the form2db hook it does redirect.
                    • 31621
                    • 23 Posts
                    It has to be one of your templates that you are redirecting to e.g for sending emails. I do have an ongoing issue with redirect on one page (which I’m trying to figure out), however, a redirect on another page works fine.
                      • 31677
                      • 5 Posts
                      Im not quit sure what you mean.

                      If I do this

                      &hooks=`spam,formit2db,email,redirect` 
                      &preHooks=`db2formit`  
                      &redirectTo=`21`
                      
                      


                      it is not redirecting

                      but this redicts

                      &hooks=`spam,email,redirect` 
                      &preHooks=`db2formit`  
                      &redirectTo=`21`
                      
                      


                      But of course I want to use formit2db, for obvious reasons. Is there something moer I hav to do?