Home Forums Backend Issues (wp-admin) New field with tabular data and many inputs: how to?


New field with tabular data and many inputs: how to?

  • I’m trying to create a new field using the ACF template kit provided by Elliot.

    My new field is a table with many inputs in the TD cells. The amount of TR rows is variable and adjusted by javascript. The table runs some calculations in jQuery and outputs them in the table foot cells. I need to save all this tabular data, not just the results.

    When I just try to hit “update” post, it does not save anything. Is it perhaps my html has many inputs? If ACF can’t handle that, maybe storing the serialized data from all the cells into a hidden field and use jQuery to populate my input/cells with it and update the hidden field with new calculations when necessary? Yet, how to tell ACF to ignore all the inputs from the TD cells?

    Can you help me please?

    Thank you

  • oh I managed it

    I created a hidden field like so:

    <input type="hidden" id="<?php echo $field[ 'name' ]; ?>" name="<?php echo $field[ 'name' ]; ?>" value="<?php esc_attr( $field[ 'value' ] ); ?>" />

    this can store my serialized data which is what I wanted

    I will use php or javascript to build a table based on the serialized data stored in the hidden field value

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

The topic ‘New field with tabular data and many inputs: how to?’ is closed to new replies.