Support

Account

Home Forums Backend Issues (wp-admin) Update field value based on value of another field

Unread

Update field value based on value of another field

  • Hi

    I have some custom posts that lists cars, motorcycles and trucks.

    The values in the ACF fileds are automaticaly populated and I cannot change them manually because they come from an external software.

    In this CPT I have 2 ACF fields (both are text fields):

    1. one called “Categroy” that can be Cars, Motorcycle, Truck.

    2. Another one called “Service”, that can be a value from 1 to 9.

    As you can see the “objects” can have different Categories but they maybe share the same “Service”.

    For example:

    Categroy = Car
    Service = 9

    Or Category = Truck
    Service = 9

    I would like to update the value of the ACF Field “Service” based on the value in “Category”.

    For example:

    if Category is “Car” and the Service is 9, then 9 should be udpated in “Rent”

    if Categroy is “Truck” and Service is also 9, then 9 should be udpated in “Buy”

    How can I achieve that?

    PS: I am a real beginner.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.