I have a section (single) that uses a template that shows information from the entry and includes a form (uses entry form) that posts to a different section (event registration info). All is fine as long as the form data is valid.

If the form is submitted such that it throws an error (required field not filled in), the user is redirected back to the original page, but only the form is displayed and there is apparently no entry ID passed when reloading the template.

Any ideas would be appreciated!

Here is the template code for the form - note that the form handles a number of different event registrations, hence the variables for the redirect and the section Id for posting the form contents:

<form id="eventReg" method="post" action="" enctype="multipart/form-data" accept-charset="UTF-8">
                        {{ getCsrfInput() }}
                        <input type="hidden" name="action" value="entries/saveEntry">
                        <input id="theRedirect" type="hidden" name="redirect" value="{{ theRedirect }}">
                        <input type="hidden" name="sectionId" value="{{ section }}">
  • Can you post your form tag definition as well as any hidden inputs inside the form? – Brad Bell Dec 15 '16 at 3:27
  • 1
    I'd test what happens with a set of hard coded values for your variables. – carlcs Dec 15 '16 at 7:36
  • Ran a couple of different tests and it appears that if you have an Entry Form on a page that also includes content from some other Entry (like instructions), and, if upon submission the Entry Form returns an error, the original page will reload with an Entry ID equal to that which was set in the SectionID parameter of the form. Brad, could you please confirm that is true? – Roi Agneta Dec 19 '16 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.