We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52108
    • 4 Posts
    Hello ModX community,

    I apologize in advance for posting in an old forum (I see most of the posts here are from a few years ago!) but I thought I would reach out in case we still have any active mxForm users. I'm a ModX newbie so perhaps this is an easy fix!

    I am attempting to implement an mxFormBuilder form into a page, but I am unable to get the form to display. Here's a little more info:

    Test page in question: http://www.ridgecrestvillage.org/index.php?id=130
    Version of ModX I am using: MODX Revolution 2.2.12-pl (traditional)
    I am inserting the TV directly into the page content, and have tried using both the cached and non-cached (!) version:
    [[!mxfb?&formid=`1`]]



    A few things about the form:
    * I am using a success message
    * None of my fields require basic spam validation



    Where am I going wrong?

    P.S. I had a few errors pop up when installing the plugin, but thus far haven't had any issues with creating forms. Example part of the log:
    PHP warning: preg_match(): Compilation failed: invalid range in character class at offset 38
    
    PHP notice: Array to string conversion
    
    chunk_err_createArray
    
    Error saving vehicle object of class modChunk; criteria: Array
    (
        [name] => emailUserTpl
    )
    


    Full error output is attached.

    Any help is very appreciated! smiley [ed. note: cweiser last edited this post 8 years, 8 months ago.]
      • 5430
      • 247 Posts
      Without reading through your error output, just a quick glance at your content field shows your calling the snippet twice on the same page. You should only call the mxfb snippet once with the form ID in place. Calling it a second time without the form ID isn't helping any. You mentioned "inserting the TV", I think you might have a misunderstanding there. In the documentation, the TV is simply a way to set the ID of the form you wish to call:

      [[!mxfb? &formid=`[[*mxform]]` ]]


      Where [[*mxform]] is the TV defining the ID number for the form. In your case, you're inserting that ID manually into the snippet call:

      [[!mxfb? &formid=`1` ]]


      That should do it if indeed you have a form created with ID 1. Definitely need to get rid of that second [[!mxfb?]]
        • 52108
        • 4 Posts
        Hi Claytonk,

        Thank you for your reply. I couldn't remember if I had left both in there for demo purposes, but I went ahead and tried your suggestion. Unfortunately, having a single snippet with a bespoke ID still does not show the form:

        [[!mxfb? &formid=`1` ]]


        The form ID is definitely "1"; the mxFormBuilder page lists [[mxfb?&formid=`1`]], which I also tried without the leading exclamation point. Any other ideas?
          • 5430
          • 247 Posts
          Just to be sure, try shutting of the rich text editor on this resource and enter the snippet call again without the wysiwyg editor running. The editor will often convert your characters to HTML entities which may prevent the snippet call from running.
            • 52108
            • 4 Posts
            Gave it a shot, no luck. sad
              • 5430
              • 247 Posts
              Have you checked your manager error log and your server error log to see if there are any clues there as to what might be happening?
                • 52108
                • 4 Posts
                I did check it last week. I inherited this website, and it seems to have quite a few issues; however, here's the error I get when trying to create new Template Variables:

                [2016-04-12 13:38:43] (ERROR @ /home6/numadgro/public_html/<ClientUrlWithheld>/core/xpdo/validation/xpdovalidator.class.php : 82) PHP warning: preg_match(): Compilation failed: invalid range in character class at offset 38