We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8741
    • 17 Posts
    I’m trying to pass values on the URL that my eForm picks up and populates hidden form field values.

    Example link I want to use:
    http://www.somewhere.com/special/?d=123456

    "special" is the name of the page that has the eForm on it. How can I get "123456" to populate the value of a hidden form field?

      • 5340
      • 1,624 Posts
      Hi,

      You can a session variable.

      1. In your previous page set a session variable
      2. In your eForm template inside the <form> add a snippet call [!readSessionOutputTag!]

      3. in readSessionOutputTag snippet
      - read the session
      - echo <input .....> or whatever your field is. Put the value of the session in the value attribute

      That should do it but eForm might detect that you are modifying the form and throw an error. If that happens ask and I’ll get back to you with a solution(or search the forums)

      Good luck
        • 8741
        • 17 Posts
        I ended up writing a snippet that grabs the value from the GET array and replaces the value in the hidden form field. The trick is that eForm checks hidden field values and defaultly validates them. It checks to ensure that the hidden value did not change. So you have to individually remove the validation on each hidden form field using the eForm validation syntax. Then I wrote my own validation in my snippet.
          • 5340
          • 1,624 Posts
          I’m glad you solve it

          I preferrer to use sessions in order to keep the URLs clean
            • 8741
            • 17 Posts
            I agree except that I needed a way to pass info from a different site.