1

I am using a Freeform Pro form where the user can edit a numeric field (number of of places booked for an event). When they click on submit, they are sent to a processing template to do the calculation in order to update the remaining number.

In the processing template that's doing the calculation, I can always access the new number set by the user in the freeform form ({freeform:field:numberofplaces}).

What I need is the number of places booked before the edit. I am trying to save it in a php variable like this on the edit freeform edit page:

<?php
 $numPlacesBeforeEdit = {freeform:field:numberofstudents};
  ?> 

But how can I pass this variable from the edit page to the processing template (the freeform edit page "return" is set to go to the processing template).

Thanks

2 Answers 2

0

You can try using PHP and EE Session Flash Data - but I believe this will work only if you use $this->EE->functions->redirect and not form submission (worth trying though)

You can also store data in PHP session using Session Variables Plugin

0

Someone suggested using Stash and that works. Any other ideas are welcome.

Update for Yuri Salimovskiy: My "edit form" where the user is changing the number of seats they require, on submit goes to a processing template that updates the relevant field with the new number. My problem was "how do I I need to keep track the original number before the user changed it" as I need both the new number and the original in the processing template to workout how many seats are left from the total available. So "saved" the original number if the form (e.g. {exp:stash:set name="numStudentsBeforeEdit" save="yes" scope="site"}{freeform:field:numberofstudents}{/exp:stash:set}) and I accessed in the processing template like this {exp:stash:get name="numStudentsBeforeEdit" scope="site"}. Hope this makes sense.

1
  • 3
    Hi Abdi! Would you mind briefly explaining how you solved this with Stash for the benefit of others who might be looking for the same solution? :)
    – Natetronn
    Feb 14, 2013 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.