Solved

Populate form fields fromanother form on submit

Posted on 2014-10-29
3
57 Views
Last Modified: 2015-03-07
Is there a way to populate a forms fields from another form on submit.

I have form one that has :
<form id="one" method="POST">
<input type="text" value="" name="first_name">
<input type="text" value="" name="last_name">
</form>

<form id="TWO" method="POST" action="THIS PAGE">
<input type="text" value="" name="first_name">
<input type="text" value="" name="last_name">
<input type="submit" Value="submit">
</form>

Open in new window

So, when I submit form TWO it auto populates form ONE with form two info?
0
Comment
Question by:rgranlund
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40412422
When form 2 is submitted then form one becomes defunct (ceases to exist) ...unless you are using javascript to do the form submission thru ajax.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40412616
Not totally sure I understand your workflow.

You could post form2 and then have the action script return you to the original page and then use the $_POST variable to autofill form1's fields.  

If your intent is to take form2's data and process it via form1's action page, you don't need form1 at all.  Just process the data via form2's action and then pass the data to form1's action for further whatevering.

Generally speaking, you don't want to present two different forms on one page and you REALLY don't want to pass data from one to the other on that page because from a UX standpoint it's confusing as all heck.  There's almost always a better way to do that using just a single form and controlling what the user sees or does via conditional scripting.
0
 
LVL 7

Author Comment

by:rgranlund
ID: 40413458
Wordpress has a E-commerce plugin, WooCommerce.  Woocommerce offers a plugin called Subscriptions.

When you goto a product page and fill out the info for your Subscription and you add to cart it takes you to the Checkout.  However, it won't let you go back to the product page and change the info, it clears it.  I'm trying to figure out a work around.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress Plug-in? - Need a landing page for a fund raiser 2 63
Move wordpress site 3 44
WP_Query multiple custom taxonomies 5 59
Split wordpress loop 35 56
Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question