We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37686
    • 94 Posts
    In my resources i have a parent document, and a child document in it.
    I need to pass over a variable from a button or link click from the parent to the child
    for example:

    -parent got a value "new york", and when i press on a request element, the child page shows everybody who lives in new york.

    I dont like much variables in my url, so thats why i would like a diffrent approach.

    THanx for time
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use a form with the links or buttons as multiple submit buttons. Some creative CSS can make very nice links.

      http://www.techrepublic.com/article/handling-multiple-submits-in-a-single-form-with-php/5242116
        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
        • 37686
        • 94 Posts
        Quote from: sottwell at Dec 20, 2012, 12:47 AM
        Use a form with the links or buttons as multiple submit buttons. Some creative CSS can make very nice links.

        ah .. lets try that..

        so i use post in stead of get
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Exactly. The form doesn't have to have anything besides your button elements. Give each button the same name. You can even generate the button elements using a snippet to get all the possible values from your database, thus eliminating the need to edit your list if you add or remove locations. Your receiving page's snippet would get the value of the button that was used to submit the form.
            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