Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpnf-copy-parent-value-manually.js: Fixed an issue where source field value is not copied over if it is a dropdown or radio button field. #873

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

barthc
Copy link
Contributor

@barthc barthc commented Aug 20, 2024

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2670546355/69628

Summary

The gpnf-copy-parent-value-manually.js snippet doesn't work when the parent form source field is a Radio button field.
This PR would fix the issue.

…ld value is not copied over if it is a dropdown or radio button field.
Copy link

Warnings
⚠️ When ready, don't forget to request reviews on this pull request from your fellow wizards.

Generated by 🚫 dangerJS against 09954e1

Comment on lines +28 to +30
var value = jQuery ( '#input_{0}_{1}'.gformFormat( parentFormId, parentFieldId ) ).val() ||
jQuery('input[name="input_{0}"]:checked'.gformFormat( parentFieldId )).val() ||
jQuery('input[name="input_{0}"]:selected'.gformFormat( parentFieldId )).val();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just stating this for posterity, this whole copyParentFormValue is very basic and by the looks of it, would likely only work for copying a single value into a text/textarea input. I'm not sure how complicated we want to make this function.

@claygriffiths claygriffiths merged commit af09afc into master Sep 5, 2024
3 checks passed
@claygriffiths claygriffiths deleted the barth/fix/69628-copy-field branch September 5, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants