• Resolved nathalizator

    (@nathalizator)


    I’m using ACF plugin to creat price field that my client will be able to edit.

    <?php the_field(‘price_car’); ?>

    I would like to know if i can directly echo the price into the Drop Down Value Field ? ( Where you can set the “Choices” Text & Value – Field Settings section )

    I have tried <?php echo get_field( “car_price” ) ?> directly in the Value Field doesn’t seems to work.

    I’m not sure if i ma clear

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    I’m sorry, but that’s not possible, you can not include PHP code as the values of the fields in the form. A solution would be create a “hidden” field, by yourself, with the “price_car”:

    <input type="hidden" name="price_car" id="price_car" value="<?php echo esc_attr(the_field('price_car')); ?>" />

    and then you can access to this field from the equation, with a piece of code similar to:

    jQuery('#price_car').val();

    Another possibility is to use the “Developer” or “Platinum” versions of the plugin, and use the “DS” fields for reading the cars prices directly from the database.

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    This is a good alternative ! Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Echo Custom Field (ACF) as Value ?’ is closed to new replies.