Hi all,
I’ve been creating a SAEF. I want the preview to be a separate template to the actual form. I followed the example in the docs but now want a little more control over the output so have created the form and form fields manually i.e
<input type="input" name="field_id_1" id="field_id_1">etc etc..
That’s all fine, now I have created a new template for the preview. Within that I have the tags:
{preview}
{MY-FIELD-1}
{MY-FIELD-2}
etc
{/preview}Again works fine.
The 2 problems I am running into are:
How do I then submit the form from this preview page so then entry gets added? I have it working by creating a whole host of hidden input fields to store the entry passed across using php like this:
<input type="hidden" id="field_id_1" name="field_id_1" value="<?php echo $field_id_1;?>" />Surely there is a better way?
My second problem is that within the SAEF I have a file input for an image, again I can pass this across fine, but if I then click back from the preview to make further edits and preview or submit the form it uploads the image again, and keeps doing so for each preview. Is there a way round this?
Perhaps I am moving back from the preview to the original SAEF wrong, I created a button named “Make more changes” which when clicked uses JavaScript to go back 1 page. Is there an EE way of doing this and retaining the form values?
Thanks,
Phil
[Mod Edit: Moved to the CodeShare Corner forum]