Automatically copy data from one field to another field in the same form

Hi there, I’ve created a reservation form with conditional logic and products in which the number of people has to be filled out.
Optionally they can use a catering service (product).
I linked a quantity field to the product and I want to automatically populate the quantity field with the number of people field in the first part of the form.
I tried automatic population using parameters and shortcodes, but I can’t seem to copy the field automatically. I know that there are some plugins on the market, but that seems to pricy for such a small extra functionality.
Hope someone can help. Thanks.

By “shortcodes” did you mean mergetags? It should be possible to do this with the mergetag value for the earlier input field, BUT you’ll need to have a page break between the original number input and the field you want to autopopulate.

Depending on what types of fields those are, you might find this helpful:

(it’s the free snippet that the plugin is based on).

Hi Bet,
Thanks a lot for your reply.
I’ve added the snippet and added an extra page break between the number fields, but I don’t seem to get it to work.
I’ve given the 2 fields a unique label name and tried to populate the 2nd number field ‘Aantal personen’ with the filled out data of the first number field 'Aantal deelnemers '. I’m probably doing something wrong, because I feel you’re proposed method should work.

I’ve attached a screenshot of the form settings. Should I working with the field ID instead of the field label or specify a parameter for the first label as well?

I tried other field types as well instead of the number field, but no joy.
Sorry to bother you with this, hope you can help.

I currently set first field to a standard number field and the 2nd field after the page break to the product quantity field.
In the image I send the field types are incorrect, I was trying out all possibilities and made 2 similar field types for testing purposes, but it didn’t work either.

I don’t think that looks like the right merge tag. It should have a field ID in it. Unless you are pulling user-meta from the user profile. But I thought you were wanting to use a number input on the form.

This plugin to find the merge tags for all the fields in your form might be helpful:

(You can deactivate and delete that plugin after you get everything set up)

Thanks for the very helpful plugin to identify the correct merge tags.
I used the correct merge tag now in the field I want to auto populate. I tried the full merge tag {Aantal deelnemers:60} and the short merge tag {:60}, but it still isn’t working.

Could it be that this won’t work because although both fields are number fields, one is a standard number field and the other is a product number field?
I’ve attached screenshots of the settings I made.

I think I would first verify that the merge tag is correct by creating an email notification with only that merge tag in it and submitting a test form. Just to rule out any issue with the merge tag and the field.

You got the snippet enabled in your functions.php file? Any chance you have some conflicts going on there? If there’s a lot of custom coding related to Gravity Forms, maybe?

Is the form embedded on a page where it has AJAX enabled? Double check that.

If all of that checks out, I think it’s probably worth it just to buy the Gravity Perk for Populate Anything. That would be cheaper than hiring an agency like us to troubleshoot.

The merge tags can’t be used as default value for fields that were filled out earlier in the form. @Estherism The Gravity Wiz Populate Anything Perk has a feature called “Live Merge Tags” that can do exactly what you need here:

Huh. I’m certain that we’ve done this before. But I’m just not remembering how we did it other than the snippet from Gravity Wiz…

Bet, I checked all of your points and tested it with and without ajax enabled. No joy.
Gravity is such a versatile plugin and I really thought that this should be possible with some tweaks.

Thank you Chris for jumping in and I did come across the plugin you mentioned before, but paying an additional 59 USD per year per site seems a lot for a perk, that should have been included in GF itself. I was really hoping that the snippet would do the trick.

Bet if you do remember how you made it work, please let me know.
Thank you both for taking the time trying to help me.

If anyone else has a workaround, please let me know.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.