Editing post after submission

I want to create a multistage form process that adds an entry to a custom post type that works in the following way

-  First the user is presented with just a few fields like title, some custom fields etc.

- Once they submit the form they are taken to another page with another form that contains the data of the entry they just submitted, but also has a bunch of new fields.   So they would be able to edit what they had just submitted, and then add in the additional fields of info.

Is this possible?

Also, can I create a conditional statement that only selects an entry where a hidden field matches a certain value?

On the first form I want to use a hidden field called “form-stage” would contain the value “1″  so when the second form is retrieved it only selects an entry where “form-stage =1″.

On the second form I would update the field to the value “2″ and then that would be considered a completed entry.

Thanks

You can pass information from the first form over to the 2nd form by customizing the redirect URL of Form 1. For example, the redirect URL might look like: [siteurl]/form2?title=[25]&custom_field1=[26] Where [25] is the field ID of your title field, [26] is the field ID of your first custom field etc.

Then in form 2, you would add fields for those and insert dynamic default values that pull the parameters out of the URL, so [get param=title] would pull in the title into the field...

I am not entirely sure I understand what you asking regarding the hidden fields and form stages. Can you explain that more?

I am not entirely sure I understand what you asking regarding the hidden fields and form stages. Can you explain that more?

Let's say a user has an incomplete form, fields missing data.   I want to be able to do a query and show links for the completed entries, and the incompleted entries.

The query would be pulling entries where the formstage=1 or where the formstage=2 etc.

Thanks

 

 

Then in form 2, you would add fields for those and insert dynamic default values that pull the parameters out of the URL, so [get param=title] would pull in the title into the field...

Does all this info have to be part of the URL string?   Is it not possible to say that when this form loads, this field get that value which actually comes from the database itself, rather than the URL?

Thanks

Are your users logged in when they submit forms?

Yes, they will have to be logged in.

I think the easiest way to do this would be in the form shortcode. On the first page, you'd limit which fields show with fields="25,26,27". You can find more detail on how to use this option in the knowledge base.
http://formidablepro.com/knowledgebase/insert-a-form/
Is that what you're looking for?

Hi Stephanie

Ok, that works in terms of only showing some fields.  But now I need to load the entire form on submit so that the rest of the fields can then be filled in. The problem with using the same form is that the redirect will put you in a loop because you will keep coming back to the same form. I need them to complete the process.

What code should I use to send them to the next page where the same form will be displayed with all the fields visible, but where the previously submitted fields will pre-populate the form?

I did try the solution mentioned by Steve but would rather pull results directly from the post table instead of having all the values come from the URL itself. Also, that results in two posts being created whereas I want to modify the one just submitted, not create a second one based on the values provided in the first.

Thanks

 

 

You can use the same form on two different pages. So on page one, you have your limited form with a shortcode like: [formidable id=x fields="field1,field2,field3"], then on page 2, your complete form [formidable id=x].

And you would follow the directions from my first response above to pass the values entered on page 1 to the complete form on page 2.

To avoid multiple entries, you could set your form to allow only one entry per logged in user (setting on the form settings page)

Hi Steve

This isn't going to work because I need people to submit more than one listing.

Can you confirm that it is not possible to do what I want with Formidable, that is to create a form that populates fields from data previously submitted.

Thanks

Ok, let me clarify... You want people to submit the short version of the form whether they are logged in or not. Then, you want to redirect to the full form to edit that entry?

You can add a bit of custom code to prevent the redirect when editing. Here's an example of the code you'd use.
http://formidablepro.com/help-desk/no-redirect-on-update-but-show-message-and-form/

Let me clarify the steps here:

1.  The person would have to first register an account.

2.  They would have to then login so they can submit a listing.

3.  The listing would be done in 2 parts:

- First just a few fields would be required.   On submitting the form a new post (custom post type) would be created with the data.

- Then the redirect would take them to a complete full view of the form with all the required fields and with the initially submitted data populating some of the fields.  This must come from the database itself, not the URL so that two records are not created, we are just editing the same record.

Also, they must be able to submit more than one listing per form.

The reason for using this approach is that if they get interrupted during a long form submission then all that partially entered info is lost.   Whereas if we are able to initially capture a few fields, like name, email etc, if they do leave it incomplete we can contact them later and help them complete the entire form.

Thanks

Thanks for the clarification. Okay, so first you'll need to set up your form to allow editing.
http://formidablepro.com/knowledgebase/allow-users-to-edit-previous-entries/

Then, your redirect url will go to the page with the long form in edit mode.
[siteurl]/page-with-long-form?frm-action=edit&entry=[id]

If this is a problem to redirect when you update, you'll need to add a bit of custom code. Here's a post with an example.
http://formidablepro.com/help-desk/no-redirect-on-update-but-show-message-and-form/

Thanks Stephanie

I'm not getting the previously submitted data populating the fields.   Is there something I need to set for each field, or should it automatically get the data?

Also, must I use the same form on both pages, or can I use an identical form with an additional hidden field on the second form?

Thanks

Did you set the form up for editing? It must be the same form in order to be able to edit entries.

Topic closed.