# How to populate form fields from fields earlier in the form

**URL:** <https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222>\
**Category:** Get Help\
**Tags:** cosmicgiant, gravity-wiz\
**Created:** [March 7, 2019, 12:46pm UTC](https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222 "2019-03-07T12:46:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5c810fb2b4c028.6](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@user5c810fb2b4c028.6](https://community.gravityforms.com/u/user5c810fb2b4c028.6)\
**Post date:** [March 7, 2019, 12:46pm UTC](https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222/1 "2019-03-07T12:46:50Z")

</div>

Is it possible to fill in a field on page 3 of a multi-page form with the value that was filled in on page 1? More generally, is it possible to populate a field from another form field. I have seen code that reads fields and outputs to a Post, but that doesn’t help.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 7, 2019, 12:57pm UTC](https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222/2 "2019-03-07T12:57:13Z")

</div>

There is no built in functionality in Gravity Forms to do that, but there are several solutions.

1. [https://forgravity.com/plugins/live-population/](https://forgravity.com/plugins/live-population/)

2. [https://gravitywiz.com/documentation/gravity-forms-copy-cat/](https://gravitywiz.com/documentation/gravity-forms-copy-cat/)

Without one of those solutions, you could create JavaScript to copy from one input to another in your form.

---

<div class="post-metadata">

**Author:** ![user5c810fb2b4c028.6](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@user5c810fb2b4c028.6](https://community.gravityforms.com/u/user5c810fb2b4c028.6)\
**Post date:** [March 7, 2019, 1:16pm UTC](https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222/3 "2019-03-07T13:16:53Z")

</div>

Thanks for the answer. I would like to try the script solution. I have seen sample PHP. The stripped-down version of code I saw is:

add\_action( ‘gform\_pre\_submission\_6’, ‘pre\_submission\_handler\_region’);  
function pre\_submission\_handler\_region( $form ) {  
country = rgpost( 'input\_30', true ); \_POST[‘input\_35’] = $region; }

- Can I use PHP instead of JavaScript? Should I?
- How do I replace the last step to write to a field instead of writing to Post?

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 4, 2022, 5:32pm UTC](https://community.gravityforms.com/t/how-to-populate-form-fields-from-fields-earlier-in-the-form/1222/4 "2022-01-04T17:32:39Z")

</div>


