Skip Navigation

[Resolved] Add values to the checkbox custom field on the admin side after form submission

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by Minesh 1 month, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2806136

Tell us what you are trying to do?
- I have a front-end form the creates a custom post type post.
- Form submission creates a post in "Pending" status.
- This custom post type has a checkbox field with some preset data.
- I also have another text field created for other data, no available from pre-made checklist field.
- I want after form submission and turning the created post into "published" status to have a value from a text field picked-up and added to the pre-set checkbox field on the admin side (not on the front-end).

For example:
Let's say I have a checkbox field "City" with a list of cities: Paris, London, Madrid. Cities are added on the admin side on the custom field level. And I have a text field "Other city" where the user can add a city, not from the list.
So if user add a city "Deli" to the text field "Other city" I would like after created post is getting a "publish" status to have a custom field checkbox field "City" update with a "Deli" city.

This way I could increase an autonomy of the custom post creation as website administrators wouldn't have to manually pickup new cities and add them to the custom field.

Do you think it is possible?

Is there any documentation that you are following?
- Unfortunately, I couldn't find any

Is there a similar example that we can see?
- Unfortunately, I couldn't find any

What is the link to your site?
- hidden link

#2806184

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Checkboxes fields are special fields and the value of checkboxes fields are stored as serialized array into database.

There is no such option to add checkboxes options dynamically that as per your requirement if X city is added to textbox "other field" when you publish the post the X city added as checkboxes option.

You can simply show/hide the "Other Field" value based on post status.

#2807056

Hi Minesh, sorry I am not sure I understood you completely.
How your solution would help me to add "X city" to checkbox field when post is published?

#2807297

Christopher Amirian
Supporter

Languages: English (English )

Hi. Minesh is not available today. He will check the ticket tomorrow.

#2807384

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

No - there is no such option to add checkbox option dynamically.