We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30884
    • 142 Posts
    Hi there,

    (using modx 0.95 + patches & eform 1.4.4 from SVN)
    I’m developing a form using eform which takes a couple of parameters from the URL. The previous help in this thread on that has helped me get those variables into the form and displaying in fields if I make them a text field. As soon as I make them hidden, I get errors telling me the rule failed. If I make them text fields (which makes them show up) then they post as you’d expect.

    I’m calling the below function from the snippet which seems to work fine etc.

    How do I treat hidden fields to become an element in the report / email to the recipient?

    Many thanks!

    Jamie

    <?php
    function GetPlaceHolder(&$fields){
        $_SESSION['eform_title'] = $_REQUEST['title'];
        $_SESSION['eform_axv_ref'] = $_REQUEST['ref'];
        $fields['title'] = ( isset($_SESSION['eform_title']) )? $_SESSION['eform_title'] : "title failed";
        $fields['axv_ref'] = ( isset($_SESSION['eform_axv_ref']) )? $_SESSION['eform_axv_ref'] : "ref failed";
        unset($_SESSION['eform_title']); //clear for next time
        unset($_SESSION['eform_axv_ref']); //clear for next time
        return true;
    }
    // For the page 'outside' of the form - old code
    $vacancy_name= (isset($_REQUEST['title']) ? $_REQUEST['title'] : "");
    $vacancy_ref= (isset($_REQUEST['ref']) ? $_REQUEST['ref'] : "");
    $modx->setPlaceholder('job_title',$vacancy_name);
    $modx->setPlaceholder('job_ref',$vacancy_ref);
    
    ?>


      p i x e l p u s h e r e x t r o d i n a i r e
      A x i s A n i m a t i o n . c o m
      • 36416
      • 589 Posts
      Quote from: TXRX at Apr 23, 2008, 07:38 AM

      ... As soon as I make them hidden, I get errors telling me the rule failed. If I make them text fields (which makes them show up) then they post as you’d expect.
      ...
      How do I treat hidden fields to become an element in the report / email to the recipient?

      Turn off eForm validation for the hidden fields.
        • 30884
        • 142 Posts
        You little beauty! Amazing what RTFM will do! I should have done that. Nice documentation btw, shame I didn’t read it a bit more thoroughly!

        Many thanks!

        Jamie
          p i x e l p u s h e r e x t r o d i n a i r e
          A x i s A n i m a t i o n . c o m