AdvancedCustomFields / AdvancedCustomFields/acf

ACF select2 : can't emulate a click on an option in Javascript

Open
#145 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hi everyone

I use acf_form() to let people editing post_type on my webiste. Works like a charm except for one thing, my first field is a selection type with advanced interface aka select2

I have one special case, when a certain user role arrives on the my acf_form(), he can't select what he wants, only 1 option is possible, and it leads to show some fields thanks to ACF's logical.

Problem is, i can't figure out how to emulate the selection of this field with javascript.
Tried so many things my head begins to burn ^^

Thanks in advance for your response and sorry if im not clear ..
++ Gilles

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with acf_form(), an ACF Select2 field, and the role-based restriction described in the report. Investigate how the JavaScript selection interacts with ACF's logical fields; done means the allowed option can be selected programmatically and the dependent fields appear correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.