3

I was wondering if it is possible to have users update their own entry on the front end with the Solspace Freeform plugin.

I get as far as getting all the necessary data of the user (freeform.submission) in a form (freeform.form) and I have added an input with the id of the entry to the form:
<input type="hidden" name="id" value="{{submission.id}}" />

When submitting this form it will save the data, but as a new entry instead of updating the existing one. So is there a way to update the existing id, similar as to what is happening in the cp?

Thanks!

1

I was able to find a solution. It's probably not the best way to go, but it works.

In the form add a new action: <input type="hidden" name="action" value="freeform/submissions/save"> which will override the standard action. It's the same form action Freeform uses to save entries in the CP.

Then add the id you want to update as value=. For example: <input type="hidden" name="submissionId" value="{{submission.id}}" />

One disadvantage is, is that this POST does not support the handle, values,.. input data for the fields - you need to use the fields id.
So
<input name="{{ firstName.handle }}" value="{{ firstName.value }}" >
becomes
<input name="field_1" value="{{submission.FirstName}}" />

You can find the field id in the CP. Some fields might need a bit more info, like email is field_3[].

  • This is not works with current freeform pro for anonymous user. Any other solution? – Mufi - Amici Infotech Feb 23 at 4:09

Your Answer

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

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