Skip Navigation

[Resolved] "if yes" function in form

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.

Tagged: 

This topic contains 18 replies, has 2 voices.

Last updated by Luo Yang 4 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#1966045

Hi there,
I have a form that the host needs to fill out in order to create a camp. I need a function where the host checks off:
"Is the camp including a sleep over?"
If yes --> another field appears that says "What do you need to bring?"
If no ---> Nothing happens and the field just says no.

#1966301

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

Hello,

I assume we are talking about a post form created with Toolset Forms plugin, you can follow our document to setup the conditional display:
https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/
Advanced Conditional Display for Form Sections

#1967199

Okay so what I want is the "Overnatning" field in the form to show up if "Yes" is checked. So I added the Conditional Group and put the "overnatning" field into the group. Then i added 2 checkboxes - 1 that says "Yes" and 1 that says "No". Now i dont know what to do to make the "overnatning" field appear to be filled out if Yes and hide the "overnatning" field if No.

Can you help?

Thanks.

#1967553

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

conditional-group.JPG

I assume we are talking about the post form "Create camp" in your website:
hidden link

There isn't field "Is the camp including a sleep over?" in it.

I have done below modifications in your website:
1) Add a custom radio field "Is the camp including a sleep over?" in post field group "Info about the camp":
hidden link

2) Edit the post form "Create camp":
hidden link
- Add field "Is the camp including a sleep over?"
- Add "Conditional Group", setup the condition, see my screenshot conditional-group.JPG
- Drag/drop the "Overnatning" field into above "Conditional Group"

3) Create a page, display above post form:
hidden link
It works fine, please check if it is what you want, thanks

#1969063

Wow thank you! It works perfectly!

#1969065

My issue is resolved now. Thank you!

#1969125

hi again ,
Is it possible to add a search filter to the search form "Search for badminton camps" where you can choose whether you want camps with sleep over or not? So the search filter could have a title like "sleep over" and then a drop down with "yes" and "no" and then it works as a filter for the camps too?

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/add-a-search-filter-to-the-search-form/

#1969973

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

I assume the original question of this thread is resolved, for the new questions, please check the new thread here:
https://toolset.com/forums/topic/add-a-search-filter-to-the-search-form/

#1971427

Hi there,
Yes it was solved ! Ill start a new ticket

#1971431

hi agian,
I forgot - regarding this - that the field should show up on the template "Template for camps - final". Is it possible to set up the field in the template so the customer can see what the kids need for the sleepover if the host chose "yes" during the creating of the camp? And if the host chose "no" it should just say "No" or maybe be a hidden field?

#1971775

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

Yes, you can display the custom field with Toolset single field block, I have setup a demo in your website:
hidden link

Test it in front-end:
hidden link
hidden link

It works fine.

#1975441

Hi lou,

Thanks i see that it works!
So both fields will be visible even though the "Sleepover field" is set to no?

Also - i can not access the option of answering on the other support ticket we have going with Taxonomies. I have no option to answer your comment. Can you see what is wrong?

#1975509

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

Q1) So both fields will be visible even though the "Sleepover field" is set to no?
Are you going to do not display "Sleepover field" when it's value is "not"?
If it is, please try Toolset conditional block, see our document:
https://toolset.com/course-lesson/using-toolset-conditional-block/

Q2) i can not access the option of answering on the other support ticket we have going with Taxonomies
Are we talking about this ticket?
https://toolset.com/forums/topic/parent-category-taxonomy/

In my side, I don't see any problem in that ticket, please try these:
1) Clear your browser cache and test again
2) if the problem still persist, please take a screenshot for it

#1977609

Hi Lou,

I think the answer function is working again for now. I will try the conditional block in the content template.

#1977957

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

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

Please update here if you need more assistance for it.