1

Is there a straightforward way of saving the input of two form fields when a form is submitted from the front end and reusing it in another form?

One field is a select2 field (Users) which can contain multiple users and the other is a number field (Log ID).

The current workflow is that a user fills out a form and it's submitted to the database. It's very likely that he will need to fill out additional forms immediately afterwards and two of the fields he inputed (Users and Log ID Number) in the first form are the same in the second form.

The workflow that came to mind was whether after first form submission, I could append the Users and Log ID into the url query string and then have them available to prepopulate in the additional forms. Perhaps on a successful form submission page, I could have a button to allow the user to submit another form and if clicked, it goes to the new form page and grabs the url query string values and enters the info in the two fields.

Totally open to other ways of seeing this too so feel free to throw your thoughts out there.

Thanks! Lori

1 Answer 1

1

I don't know if we can compare the problem I usually have but here is my way.

Whenever I build a website where users can login and save "entries" they also need to stay connected to it off course. I make sure the title of the new made entry got the users ID in it. So if someone makes a new entry they go to a succes page after the form is submitted. This success page is actually the entry they created. The moment they land on that page the "second" form will be automatically filled in with the details I need and then save/update whatever needs to be updated (most of the times for me that would be saving the entry to a user profile). After the second form submit's I redirect them to the page I want.

This would include some javascript.

1
  • Thanks for your suggestion Justin. There are multiple additional forms that the user could choose from if they needed to submit another form so I don't think in my situation I could embed another form. The two fields I'm wanting to pass are included on every other form though.
    – Lori
    Jul 19, 2017 at 14:14

Your Answer

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

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