Solved

Populate form fields fromanother form on submit

Posted on 2014-10-29
3
61 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

734 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