Solved

Populate form fields fromanother form on submit

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
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 Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now