Skip Navigation

[Resolved] Create a checkbox (I agree) that will be saved for each member that marks it.

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

Problem:

We need to create a page where members can read the content and in the end of it check a checkbox and press "I agree". The value of that checkbox should be saved for each member in their Profile (user field ?)

Solution:

I suggest you try these:
1) Create a custom user checkbox field

2) create a user form for editing current user, Then your user will be able to enable the checkbox field and submit the form, it will be saved into user's profile page.

3) For admin user, you can create a user view to list users, show each user's information, and the checkbox field value

Relevant Documentation:

https://toolset.com/documentation/user-guides/user-fields/

https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

https://toolset.com/documentation/user-guides/displaying-wordpress-user-fields/

This support ticket is created 6 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Luo Yang 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1122700

We need to create a page where members can read the content and in the end of it check a checkbox and press "I agree". The value of that checkbox should be saved for each member in their Profile (user field ?). And we will also want to be able to sort users based on this checkbox value (1 or 0, agreed or not agreed).

How to accomplish this in an easy way?
Thinking out loud here...
1. Create a page and add som text.
2. Add a conditional output, at the end of the page, using Access to show the checkbox+submit button or not (user need to be logged in to see it) .
3. User can at any time visit the page and change value of this checkbox.
4. Each user should have their saved value and it should be visible when browsing the user list as admin.

Why this?
We want users to read a Code of Conduct and in the end of the year we need to see if somebody still hasn't read (checked the checkbox) it.

#1123435

Hello,

I suggest you try these:
1) Create a custom user checkbox field
https://toolset.com/documentation/user-guides/user-fields/

2) create a user form for editing current user
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/
Then your user will be able to enable the checkbox field and submit the form, it will be saved into user's profile page.

3) For admin user, you can create a user view to list users, show each user's information, and the checkbox field value
https://toolset.com/documentation/user-guides/displaying-wordpress-user-fields/

#1123586
Skärmklipp 2018-10-09 12.47.37.png
Skärmklipp 2018-10-09 12.46.04.png

Thx for the heads up Luo,
Unfortunately when I try to embed the form on my page, the shortcode isn't handled the correct way.
See attached image of admin view and public view.

Thanks, Pierre

#1124284

This is abnormal, please check these:

1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

2) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1124465

Thanks for the details, it seems you have changed the Form codes manually, there are some required shortcode missing, please try these:
Edit the user form "Accept Code of Conduct"
hidden link

in section "Content", modify the codes to below:

[creduserform]
	[cred_field field="form_messages" class="alert alert-warning"]
	<div class="form-group">
		<label>I have read and agree</label>
		[cred_field field="i-have-read-and-agree" force_type="field" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>Title</label>
		[cred_field field="user-title" force_type="field" class="form-control" output="bootstrap"]
	</div>
	[cred_field field="form_submit" output="bootstrap" value="Submit" class="btn btn-primary btn-lg"]
[/creduserform]

And test again.

And I suggest you generate the Toolset form content by clicking the button " Auto-generate form content", then remove non-needed fields manually.

#1124507

My issue is resolved now. Thank you!
Worked like a charm 🙂

#1125080

You are welcome.