So I have an options page that I am using as sort of a button builder where you can select colors/styles/assign class names etc. which are in a repeater to create multiple buttons of different styles. On the front end all you do is add the css style assigned in the acf field to an anchor tag and it styles it. Anyway, what I am wanting to do is generate a preview within the options page in the back end (preferably on the fly with ajax) for each repeater row created. Is there any way to do this or can someone help direct me in the right direction? Thanks.
I’ve built something like this, but not for repeater fields, and not for buttons. I’m working on a reviews plugin and allowing the admin to set the colors and some other style features.
I use a message field for the preview.
I also have several other fields. Each of these fields has several specific classes, one class that designates that it is a setting field and one that designates what the setting is. For example, all of the fields have a class “star-setting”. Basically, there is an JS action hooked to this class so that if any of the setting fields is altered it triggers an refresh of the preview.