Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:59:25+00:00 2026-06-08T22:59:25+00:00

I am learning modx and stuck at a point. I want to post uid

  • 0

I am learning modx and stuck at a point. I want to post “uid” value to next page via POST only and want to set hidden field which will contain “uid” as a value. I believe practically its not allowed to pass values to chunk.
I want to know whats the proper way so i can get POST data and use that value in chunk ??

My procedure

1) I have created resource (document) which contains call to snippet and then chunk

2) snippet contains value retrieved from POST

3) chunk contains a form and fields, I want to inject that POST value in this form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:59:26+00:00Added an answer on June 8, 2026 at 10:59 pm

    There are several ways you could do this.

    1) Return the uid value directly from the snippet (let’s call it getPostData), and place the snippet call in your hidden field in the chunk like this:

    <input type="hidden" name="uid" value="[[!getPostData]]" />
    

    Note the snippet is uncached ([[! opening tag) otherwise the first form submission will be cached.

    2) Place the snippet call in the chunk tag and have the value passed into a placeholder:

    [[$myChunk?uid=`[[!getPostData]]`]]
    

    …and in your chunk set an uncached placeholder for ‘uid’:

    <input type="hidden" name="uid" value="[[!+uid]]" />
    

    3) Recommended: Use setPlaceholders() in your snippet to output content to placeholders anywhere in your page – you can use it to output to multiple placeholders:

    <?php
    // please sanitise your POST values, this is just an example
    $placeholders = array();
    $placeholders['uid'] = $_POST['uid'];
    $placeholders['email'] = $_POST['email'];
    
    $modx->setPlaceholders($placeholders);
    

    …and your chunk:

    <input type="hidden" name="uid" value="[[!+uid]]" />
    <input type="email" name="email" value="[[!+email]]" />
    

    Documentation: http://rtfm.modx.com/display/revolution20/modX.setPlaceholders

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Learning Scala currently and needed to invert a Map to do some inverted value->key
I started learning haskell yesterday and I got stuck on a problem. After a
Learning how to do a master page in asp.net. Trying to figure out how
Learning .NET: I have a form with a split container, I want to load
Learning about Explicit Cursors and trying to create my frst one.: SET SERVEROUTPUT ON
Learning sed, I want to change the drive letter of the following input lines
Learning haskell and want a function to generate a 2D grid similar to how
Learning XML Schema, I want to be able to have collections of elements inside
i learning CFNetwork , socket, i almost completed. But, I want to use UIImageView,
Learning more about code contracts, they seem like something I want to use in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.