Skip Navigation

[Resolved] Post-form-with-custom-fields-conditional-select

This support ticket is created 5 years, 8 months 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by RamilA8226 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1332601
Screen Shot 2019-09-05 at 9.41.03 AM.png

Tell us what you are trying to do?
I want to create 5 checkboxes or select option and once the user select an option they will get more options. For ex: If they select the city new york they should get all the city names.

Is there any documentation that you are following?
Yes - https://toolset.com/forums/topic/post-form-with-custom-fields-conditional-select-option/
But I'm not very good with custom coding 🙁

Is there a similar example that we can see?
n/a

What is the link to your site?
n/a

#1332769

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-08-30 at 9.23.44 AM.png

Hi Ramil,

Thank you for contacting our support forum.

Since you are using the visual builder, there should be a conditional widget that you can drag to your form to create the conditional group.

However you will need to create a checkbox/select that contains all the city names in "New York", similarly you will need to do this for all the other countries that you will select.

The conditional group widget should be under the Extra Elements section.

Please let me know if this helps.

Thanks,
Shane

#1332787

Hey Shane,

#1332789

Hey Shane,

Thanks for your prompt response. I'm trying follow the documentation but having hard time to target Condition Group element when an action is taken for ex: if Brooklyn Checkbox is selected it will show brooklyn cities I know I have to add these cities within Condition group. Does this structure look ok? hidden link

Do I have to create multiple conditional group or I can have multiple selects in one conditional group? Also how can I target these "selects" when user click a City name?

#1332801

I'm following this documentation https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/?utm_source=credplugin&utm_campaign=cred&utm_medium=conditional-group-dialog&utm_term=See%20our%20documentation%20on%20conditional%20display%20for%20form%20inputs

and I'm stuck here hidden link

All I'm trying to do is...

1) Create a form that would collect Name, Email and a payment of $69. Form will also collect the city name where user like enroll. So I wanted to add checkboxes or select option and once user click one of the checkbox they get more option to select.

2) Use WooCommerce coupon feature somehow with the form?

#1332915

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ramil,

"if Brooklyn Checkbox is selected it will show brooklyn cities I know I have to add these cities within Condition group. Does this structure look ok? hidden link"

Yes this is setup correctly but I did a quick test on my end and it would be best if you created the fields in Types since you can setup the conditionals there and they will carry over into your Forms once you have created the form..

So you can use the documentation here
https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/?utm_source=credplugin&utm_campaign=cred&utm_medium=conditional-group-dialog&utm_term=See%20our%20documentation%20on%20conditional%20display%20for%20form%20inputs

To setup the conditionals for your custom fields on Types.

The way you have it now as generic fields, they won't show up in the Post if the Post was created on the backend and i'm assuming you want to retain this on the backend as well.

1) Create a form that would collect Name, Email and a payment of $69. Form will also collect the city name where user like enroll. So I wanted to add checkboxes or select option and once user click one of the checkbox they get more option to select.

This will be possible once you setup the form and add the woocommerce payment option to the form. The documentation below would be able to assist you with this.
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/

2) Use WooCommerce coupon feature somehow with the form?

You are not able to show the coupon feature on the form, however if you coupon option displays the coupon box on the checkout page then this should work as well.

Thanks,
Shane

#1332927

Hey Shane,

I already tried that documentation but I couldn't understood the conditions hidden link think you can explain me what is condition and how to use it?

#1332987

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ramil,

Sure this asks you to select a field to based the condition on.

Lets say you have field A with options 1 , 2 , 3

But you want field B to display only when option 3 is selected.

So on field B you will click the Set Conditions button to create a conditional for Field B. So in the conditional you will select Field A then for the comparison you will select equal to and then finally you set what it should equal to. In this case 3

Essentially what this is saying is "IF field A = 3 then display field B". Field B will only display if the user selects the value 3 in Field A.

Please let me know if this clears it up a little for you.

Thanks,
Shane

#1332991

Hey Shane,

I really appreciate your support on this and now I feel like I'm moving with the plugin.
I'm gonna test this out...BTW do I have to set same condition within post form? hidden link

Thanks!

#1332995

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ramil,

If you set up the conditionals in Types in the Custom Field section where you create the custom fields, then you won't need to re-add the conditional here.

Thanks,
Shane

#1332997

Hey Shane,

Just FYI it looks I do have to set the conditions here as well otherwise it doesn't work for me hidden link

#1332999

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Ramil,

Would you mind allowing me to have access to the website so that I can check on this for you as this should not be the case.

Thanks,
Shane

#1333015

Hello Shane,
This is a new topic and I'm sorry I'm adding this here 🙁

I have set the Field Group to Post Type: Pages as I will be adding these forms to pages as you can see here hidden link

But when I go to any page its asking me to fill the form and I'm not able to preview or update the page please see here hidden link

How can I turn that off? and why is it even showing there when I'm creating a frontend form?

#1333029

Hey Shane,

I noticed one more issue when displaying the form and I wasn't able to submit to go to the payment process. I have made a video so you can understand better hidden link

Just to confirm the issues we are facing:
1) Conditions setting issue (that you are already looking into)
2) Unnecessary meta box in a page
3) Displaying form and payment processing.

#1333539

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-09-06 at 9.12.32 AM.png
Screenshot 2019-09-06 at 9.09.55 AM.png

Hi Ramil,

In response to the Post here
"I have set the Field Group to Post Type: Pages as I will be adding these forms to pages as you can see here hidden link

But when I go to any page its asking me to fill the form and I'm not able to preview or update the page please see here hidden link"

The issue is that you've created the fields and added it to the Pages post type but you've set the fields as required, so you wouldn't be able to save the posts unless the fields are filled out.

Secondly your issue in the video is because the form you've created is an Edit form. This kind of form is to allow for the editing of existing posts of the specific post type that you've specified. Have a look at the screenshot

If you notice you've set the form to Edit pages. This means this form won't create any new content but its used to edit existing pages.

What you need to do is to build a form to Add new content.

In summary.

Just to confirm the issues we are facing:
1) Conditions setting issue (that you are already looking into)
A) Which field group should I be looking at to setup the conditionals ? Also the field group needs to be assigned to a Post type for me to prepare a proper demo for you.

2) Unnecessary meta box in a page
A) This is because of the fields being required and being assigned to the Pages post type. To resolve this and set the field to a specific post type you need to use the Appears on setting and select the post type you want the fields to show up on. See Screenshot.

3) Displaying form and payment processing.
A) To add payment processing to your forms you will need to follow the instructions in the link below.
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/

Thanks,
Shane