We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26925
    • 44 Posts
    Hi,
    I made a placeholder in modx to capture url parameter by using $_GET which is working fine.
    But when I use this placeholder as a ‘value’ of a hidden field of my form it is not getting saved in the hidden field as I could see from the page source.

    Kindly help..
    thnks
      • 3109 ☆ A M B ☆
      • 894 Posts
      Where are you storing your hidden value in a chunk or a snippet? Remember chunks can’t have php code so if your trying to store the value in a chunk it wont work since it wont be executed. Post some more details so we can have an idea what the problem is smiley
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 26925
        • 44 Posts
        hi,

        I have made an enquiry form in which I kept few hidden fields to capture the url parameters in them. The problem is those url parameters are not getting inserted in the hidden fields

        This is how I did it all:

        I made a snippet A,
        
        <?php
        $modx->setPlaceholder('ememail',$_GET['eme']);
        $modx->setPlaceholder('keyword',$_GET['kw']);
        $modx->setPlaceholder('eventurl',$_GET['url']);
        
        $modx->setPlaceholder('emname',$_GET['emn']);
        $modx->setPlaceholder('emmobile',$_GET['emm']);
        $modx->setPlaceholder('title',$_GET['et']);
        date_default_timezone_set('Asia/Calcutta');
        $enqdate = date('D, d M Y, h:i:s A');
        $modx->setPlaceholder('enqdate',$enqdate);
        $modx->setPlaceholder('redirect',$_GET['redirect']);
        ?>
        
        
        
        


        Then I made an enquiry form chunk with this code in it:
        
        <input type="hidden" name="ememail" size="40"  value="[+ememail+]"  />
        <input name="keyword" size="40" type="hidden" value="[+keyword+]" />
        <input name="eventurl" size="40" type="hidden" value="[+eventurl+]"  />
        <input name="emname" size="40" type="hidden" value="[+emname+]"/>
        <input name="emmobile" size="40" type="hidden" value="[+emmobile+]" />
        <input name="title" size="40" type="hidden" value="[+title+]"/>
        <input name="enqdate" size="40" type="hidden" value="[+enqdate+]"  />
        <input name="redirect" size="40" type="hidden" value="[+redirect+]"  />
        
        
        


        The above code is just a part of the enquiry form chunk.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          What is merging the form with the placeholders? Do you have the PHx plugin installed? Is this an eForm tpl? Too many other questions without answers to which it’s impossible to determine what’s going on here.
            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