Support

Account

Forum Replies Created

  • @keithlock Hey

    Can you please let me know how to run a function that update sub-field when I click on “add row” button?
    Because “acf/load_value” not make it.. it just overwrite the exist rows, but new row are still empty

    I give up for the word,
    just want to run function that when I click on “add row” – I will get new row with empty fields, except one field that will be random 3 digits

  • I have website, and posts, in every post I have text field which called “codename” and repeater field which called “coupons” – it have 3 sub-fields – name, description, code

    For example – I create post, and fill in “EXAMPLE” in the “codename”
    Then I want to create coupons. what I want the system to do is –
    Everytime I’ll click on “add row” I’ll get a new row in the repeater (default behavior), BUT I want the sub-field “code” to get value automatically “EXAMPLE-764” or “EXAMPLE-421” etc…

    I should take automatically the field codename and add to it a 3 digits random number

    To make random number – I know.
    I just need to know:
    1. how to run function when admin click “add row”
    2. how to get the value in other field (before it published…)
    3. how to update the subfield value in the add post page (and not in database, after the post was published, like “update_field” function does)

    Hope it is more understandable now
    Thanks for helping 🙂

  • Hey @keithlock,
    Thanks for helping.

    It’s seems to be a good solution, except that I don’t know how many coupons there’s gonna be, plus what if I make 3 coupons, then want to add another one? I should update the number input over and over again?

    In addition to that, I can’t understand where I should put that piece of code? I need that in the moment that someone make a new row in the repeater input, it will get the “EXAMPLE” word and add to that some 3 random number.

    There is some function/hook to run in the second that user create new row in reapter? so I can run a function that get the steady field word and add to that random number and update the sub-field?

Viewing 3 posts - 1 through 3 (of 3 total)