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

Use within repeater #7

Open
solech1 opened this issue Mar 2, 2018 · 3 comments
Open

Use within repeater #7

solech1 opened this issue Mar 2, 2018 · 3 comments

Comments

@solech1
Copy link

solech1 commented Mar 2, 2018

Many thanks for this script! Any one able to help with adapting this to work exactly as is, but in a repeater field. So, in the "Post" post type, you can have both the state select field and the city select field in a sub-field then repeated.

Any help very much appreciated!

@Hube2
Copy link
Owner

Hube2 commented Mar 4, 2018

When working with repeater fields, what you need to do is figure out what row you working on and then adjust base on that.

For example, get the row of the current field
var $row = e.$el.closest('.acf-row');
the you need to find the other field in the same row.
var $select = $row.find('[data-key="field_5793770922131"] select');

@solech1
Copy link
Author

solech1 commented Mar 5, 2018

Awesome, thanks!

@solech1 solech1 closed this as completed Mar 5, 2018
@solech1
Copy link
Author

solech1 commented Mar 13, 2018

Hi @Hube2, sorry to resurrect this thread. Any idea why this wouldn't save? The solution above works for populating the select within the repeater, but wouldn't save. Many thanks!

@solech1 solech1 reopened this Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants