[Resolved] Form filtering Post Type in View is displaying but not saving the input data

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.

Our next available supporter will start replying to tickets in about 3.66 hours from now. Thank you for your understanding.

Related documentation: CRED Forms for Child Content

This topic contains 6 replies, has 2 voices, and was last updated by  Luo Yang 8 months, 1 week ago. The support staff assigned to this topic is Luo Yang.

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

I am trying to: Hello we are filtering a post type in a view before using a sort code to display the data in a dropdown/select input element, the data is displaying fine, but when the form is submitted the input element recorded but other standard form data is. I have double checked the postmeta for the submitted form to confirm this.

Thank you

Link to a page where the issue can be seen:

View: hidden link

Form: hidden link

Post Type for the Filtered data (Drivers): hidden link

I expected to see:

The form shows the filtered data under the label "New List:" and the same data using the standard method of showing data in a form (but clearly not filtered) under the label (Old List).

Instead, I got:

So "New List" data is not being saved or sent through via email which we want it to do.


Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

Dear Peter,

Thanks for the details, I can login your website.
But I am not sure where and how I can see the problem you mentioned:
So "New List" data is not being saved or sent through via email which we want it to do.

Could you describe detail steps to produce above problem?



Sorry if it was not clear - have tried to explain the issue -

The Driver post type is a parent of the Booking post type.

Originally we had a Select field on the CRED Add Booking Form (ID:24) that just bought through every Driver Name so a Booking could be assigned to the correct driver. This was achieved with the following Shortcode -

[cred_field field='_wpcf_belongs_driver_id' value='' required="true" class='form-control' output='bootstrap']

This is still on the CRED form labelled as Old List.

We need to filter the list of Driver Names based on whether they are Approved in the new Driver Select field called 'driver-allowed' - so we want the Select to only show Drivers who are marked in the field as Assigned(1) and not display Drivers marked as Suspended(2) or Left(3). We have created a View that filters the Driver Posts called 'Driver Allowed'

The issue is we have put the output of the View into a generic Select field on the Add Booking form so the correct list is displayed (labelled as New List), but the Booking is not writing the chosen value with the Booking Post as a child of the chosen Driver post.

The generic field on the form shows the filtered drivers in the Select dropdown, but does not appear to write the value to the database and the Booking is not registering as a child record of the parent Driver.

<select field='driver-allowed' name="driver-allowed" id="cred_form_24_1-select-1-1505305099" class="form-control wpt-form-select form-select select select js-wpt-validate" output="bootstrap" select_text="HINT: Type first letter of Drivers Christian Name for speed" data-wpt-field-title="driver Parent" data-wpt-type="select" name="select-_wpcf_belongs_driver_id">

  [wpv-view name="driver-allowed" orderby="title" order="asc" cached="off"]


How can we get the chosen name to correctly save so the Booking is a child of the correct Driver?


Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, I am checking it in your website, will update this thread if there is anything found, but I am on a trip, may answer it later.


Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

In your case, it needs some PHP codes, for example you can try with CRED action hook "cred_save_data",

When user submit the CRED form, use action hook "cred_save_data", trigger a custom PHP function
This hook allows doing a custom action when post data is saved to database.

In this PHP function, get the value of your "generic Select field", and save it into database:


Hello, thank you for that I have been able to use the 'cred_save_data' to save this data to the database.

However even though this data is now saved as postmeta along with the rest of the post data to "post_type": booking all data except for this postmeta can be show shown using

[types field='order-number'][/types]

on the website by using a using a template "Toolset > Content Templates > Bookings Display" however

[types field='driver-allowed'][/types]

does not return any data?

hidden link


hidden link

So is there a way of making a "Content Template" pull postmeta directly for the post it is displaying ?

There is also a second issue of the information not being able to appear in the email sent on form submit, though solving this is less important.


Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

It is a new question.

Since you did not point out the problem page URL, where and how can I see the problem:
[types field='driver-allowed'][/types] does not return any data.

So I have to guess what happened in your website, I assume we are talking about this case:
in the single "booking" post, for example:
hidden link

there should be some result just after text:
"Data Should display here:"

If it is, please edit the problem single "booking" post, see here:
hidden link

There isnt' any custom field that is using name "driver-allowed" , "driver allowed" something like this.

So there isn't custom field "driver-allowed" in the single "booking" post, as a result, the shortcode [types field='driver-allowed'][/types] will not output anything in the front-end.

If you are going to display the field value from other post/page, you can specific the "id" attribute of the Types shortcode, for example:
[types field='driver-allowed' id="12345"][/types]

More help:
Attribute "id":
"$parent" | "post-id" | "$custom post name"
Displaying Fields of Parent Pages

And please create new thread for the new question, that will help other users to find the answers. thanks

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