Skip Navigation

[Resolved] Split: forms: set value of a field based on value of a previous field on the form – 2nd part

This support ticket is created 3 years, 3 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
- 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 20 replies, has 2 voices.

Last updated by brendaT-2 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2314103

Minesh
Supporter

Languages: English (English )

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

Ahh ok. I just show you the way, you are welcome to make any changes as per your requirement.

There is nothing user is going to click, [wpv-conditional] shortcode is used to display the content conditionally. So, as per the conditions setup, if those are satisfied then based on that whatever you configured to display (in this case we added form) it will display it. When you display the page page: hidden link
- it will automatically display the correct form based on configured conditions.

You can use the modified conditional code and add it to your directory listing page:
- hidden link

You may also want to add role for administrator so that administrator can access the form when accessing the site on frontend.

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/

#2314113

Oh wow that blows my mind. you think way above my realm. Thanks so much for your instructions - it is a great learning curve for me so thanks for sharing your knowledge.
One more question for me! The conditional code ([wpv-conditional if="...).
- do I add that to the pages (like "My Account ", "Directory Search" & "Directory Result" pages) myself or anywhere I want to display the form link? Meaning you have provided for my benefit, and I can put wherever I like?

#2314121

oh, ok I see you have added a Directory Listing Form PAGE.... OK!
It says you are still editing it. Can you pls hop out and I will play around with it...thanks.

#2314133

Minesh
Supporter

Languages: English (English )

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

Our role is to show your the way, you are welcome to modify the code as per your requirement and place it at whatever place you required and more important check if its working as expected as per your requirement.

You can apply your logic and build your site 🙂

Please kindly open a new ticket with every new question you may have. Thank you for understanding.

#2314137

Minesh
Supporter

Languages: English (English )

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

Ok I do not added any page. The page "Directory Listing Form" was there and it was holding just [cred_form form="directory-form"] form.
=> hidden link

Now, you add the conditionals and adjust conditionals and display the both forms as per your requirement.

[wpv-conditional if="( '[types usermeta='membership-type' output='raw' current_user='true'][/types]' eq '20711' ) OR
( '[types usermeta='membership-type' output='raw' current_user='true'][/types]' eq '20712' )"]

[cred_form form="directory-form"]

[/wpv-conditional]

[wpv-conditional if="
( '[types usermeta='membership-type' output='raw' current_user='true'][/types]' eq '20713' ) OR
( '[types usermeta='membership-type' output='raw' current_user='true'][/types]' eq '20714' ) OR
( '[types usermeta='membership-type' output='raw' current_user='true'][/types]' eq '20715' )"]

[cred_form form="directory-standard-form"]

[/wpv-conditional]

I close the page. You are take it over and you are welcome to mark resolve this ticket.

#2314147

My issue is resolved now. Thank you!
I now have EVERYTHING working for my listers & their memberships. It is a very elegant solution which meets my business needs. Minesh is to be commended for his willingness to understand what I was wanted to achieve. THANKS!