We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8895
    • 76 Posts
    hi modx fans

    ive made a little form using a few chuncks and a snippet,
    basicly the snippet builds the form and also handles the post,
    while the chuncks are used to call the snippet etc

    the form displays perfectly and the html code looks ok (compared to others ive successfully done)

    <form action="" name="SendMailForm" id="SendMailForm" method="POST">
    <input type="hidden" id="qnr" name="qnr" value="0"  /><input type="hidden" id="type" name="type" value="M"  />
    
    ...
    more fields
    ...
    
    <fieldset>
    <label class="textarea" for="msg">Message</label>
    
    <textarea id="msg" name="msg" rows="5" cols="30" ></textarea>
    
    </fieldset><fieldset>
    <input type="submit" id="submit" name="submit" value="Submit" style="width:90px;" />
    
    </fieldset>
    
    </form>
    

    and just to mention it, ive also tried
    action="[~[*id*]~]"
    as well as
    action="/[~[*id*]~]"

    and just in case it might matter, i have friendly url’s and path’s enabled

    and at the beginning of the snippet i have an if to catch the post

    if ($_POST[submit])
    {
    	$msg = 'SUCCESS!';
    }
    else
    {
    	$msg = 'fu';
    }
    ...
    code to build the form
    ...
    return $msg;
    


    has someone got a clue why this isnt working?
    its driving me crazy huh

    thank you all in beforehand
      • 22840
      • 1,572 Posts
      As you havent actually posted all the stages IE: snipppet, Chunk etc I can only guess but try [~[+id+]~] or [+id+]
        • 8895
        • 76 Posts
        hi thanx for your reply, unfortunately that didnt help

        the chunks etc are built up as follows:
        actual page calls main chunk
        {{Main}}


        the main chunk contains
        [[MemberCheck? &groups=`user` &chunk=`Mail`&debug=`true`]]


        the following mail chunk then contains
        {{Form}}
        {{Table}}
        


        here the table chunk is still empty and the form chunk contains
        [[Form]]
        <div class="formError">[+formError+]</div>
        <div class="formMessage">[+formMessage+]</div>
        [+Data+]
        
          • 20413
          • 2,877 Posts
          That is a lot of nesting going on...
          What if you use
          [!MemberCheck? &groups=`user` &chunk=`Mail`&debug=`true`!]

          or your form snippet
          [!Form!]

          inside of resource content or in your template?

          Notice [!___!] uncached call


          What MODx version and Snippet version are you using?

          Worth linking: http://modxcms.com/forums/index.php/topic,40549.msg244657.html#msg244657
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 8895
            • 76 Posts
            aaah yes, totally forgot the !!!’s

            unfortunately when changing "[[Form]]" to "[!Form!]" it will just print "[!Form!]" without actually processing the snippet

            as i changed the member check it worked! fantastic

            thank you very-very-very much! grin