Solved

Populate form fields fromanother form on submit

Posted on 2014-10-29
3
52 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

809 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