Skip Navigation

[Resolved] How can I display checkboxes output by created cred forms with views?

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display checkbox in CRED form

Solution:
To display checkbox field with CRED form:

1)
created Custom Checkbox field in Types.
2)
inserted that created field in CRED Forms or click on button "Auto Generate" to generate all whole form automatically.

Relevant Documentation:
https://toolset.com/documentation/user-guides/creating-cred-forms/

This support ticket is created 8 years ago. There's a good chance that you are reading advice that it now obsolete.

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 3 voices.

Last updated by Adriano 8 years ago.

Assisted by: Minesh.

Author
Posts
#390068

I am trying to:
display checkboxes output with views 'contents template'.
The checkboxes are created by CRED forms.

ex)
Aromas
[V] Fruit
[ ] Floral
[ ] Vegetal
[ ] Animal

I expected to see:
the outputs like this.
Aromas : Fruit

Instead, I got:
'Array'.

I use below code to display datas with views.

[wpv-post-field name='td-aromas']

Then I get any datas of 'td-aromas' like 'radio', 'textfield', select' by created CRED Forms.

But, in case of checkbox, It didn't work.
There are some answer in this forum using php code.
But, I am creating pages using Views in 'Toolset'

So, How can I get the datas with checkboxes?

#390110

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I do not understand how you created checkbox field using CRED. Is your checkbox field created under Types?

Normally, you can display checkbox as follows:

[types field="my-checkboxes"][/types]
// Will output a comma separated list of values for each checked checkbox

[types field="my-checkboxes" separator=" - "][/types]
// Will output a list of values for each checked checkbox separated by a dash.

More info:
https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes

#390132

I used like this (by CRED Forms) :

[cred_generic_field field='td-aromas' type='checkboxes' class='' urlparam='']
        {
        "required":0,
        "validate_format":0,
        "persist":1,
        "default":[],
        "options":[
        {"value":"1","label":"Fruit Aromas"},
        {"value":"2","label":"Floral Aromas"},
        {"value":"3","label":"Vegetal Aromas"},
        {"value":"4","label":"Animal Aromas"},
        {"value":"5","label":"Grilled Aromas"}
        ]
        }
        [/cred_generic_field]

CRED has a funtion creating checkboxes field basically.
I used it.

Normally, Custom fields created by Types use '[types field="my-checkboxes" separator=" - "][/types]'.
On the other hand, that fields created by CRED use '[wpv-post-field name='']' in Contents Template.

#390147

Hello.
I resolved it.

First, I created Custom Checkbox field in Types.
Second, I inserted that field in CRED Forms (not using CRED checkboxes field).
Third, I loaded that field in Content template from 'Field and View' button.

Thanks.

#390603

You are welcome.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.