Skip Navigation

[Resolved] Building a Form Using the Classic View

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 9 replies, has 2 voices.

Last updated by Minesh 11 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2670491

Tell us what you are trying to do?
I created some CPTs and custom fields. I did this in the back end using the classic view. This allowed me to do some custom css/js.

One of the custom fields is a checkbox. In my view, I used html/css to turn the checkbox into a toggle for the UI.

I want to have the toggle change event make the change to the checkbox in WP and record the check/uncheck to the database.

I figured I could use Toolset forms to accomplish this, but I cannot see how to build the form using the classic view and did not find any documentation.

Is this possible with toolset forms? Can I do this or do I need to go down the custom code route?

Is there any documentation that you are following?
N/A

What is the link to your site?
hidden link

#2670607

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Toolset Views and Toolset Forms are two different entities.

You can use views to build the custom search where you add the custom search filters (custom fields, taxonomies) to filter the view results - that you already did. The custom search filters belongs to view. That you can change the filters to filter the view results.

Toolset Forms are used to create/update the post items or create/update user profiles. In your case it should be post form but as I shared post forms are used to create/update post items and what you want is to record the custom search filter checked/unchecked actions. There is no such feature available. Even if you try to hook-in the Toolset form, toolset form will create new post with every action and that is no the feasible solution.

You may need activity log plugin as follows but it does not record the changes of custom search filters:
- https://wordpress.org/plugins/wp-security-audit-log/

I suggest you may rethink how you want to implement this feature with your site or you are welcome to contact any of our certified partners:
- https://toolset.com/contractors/

#2670777

So you are saying that I cannot build a form to embed into a view that updates the CPT?

#2671011

Minesh
Supporter

Languages: English (English )

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

What I'm saying is you can embed the form in to search result for every item found but not with the custom search filter.

#2671061

How can I embed it in the view?

#2671063

Minesh
Supporter

Languages: English (English )

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

If you want to update a single post within the view item - then you should create a post form to edit the content:
- https://toolset.com/course-lesson/front-end-forms-for-editing-content/

Add this form to your view's loop so the form will be available to edit single post of loop item having said that if you have ten post then you will have ten edit forms. If you do not want to add form within the view's loop then you can also add the post edit link:

Here is the Doc that shows how you can add post edit link within the view:
- https://toolset.com/course-lesson/front-end-forms-for-editing-content/#adding-an-edit-link-to-a-list-of-items

#2672127

I figured out how to add a form in the classic view builder. I would like some direction on how to build my form. This app is going to be a simple check in and check out form. In the loop, I would like a simple toggle button that the user can tap to switch between in and out. This is tied to a check box on the CPT. Is it possible to use forms to have a simple toggle and no submit button, but have it submit upon toggle change event?

#2672867

Minesh
Supporter

Languages: English (English )

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

You can trigger the form submit by adding the custom Javascript/jQuery code:

For example:

jQuery("input[type='checkbox']").change(function() {
jQuery(this).submit();
});

you can adjust/modify the selector as required.

#2673115

Is there a way to submit asynchronously without reloading the page?

#2673475

Minesh
Supporter

Languages: English (English )

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

Toolset offers a Ajax submission. So you should try to add submit button also on your form and hide that button and try to trigger the click event for that form submit button on change event of your checkbox/radio button.

On your edit form paage:
- https://toolset.com/course-lesson/front-end-forms-for-adding-content/#creating-the-form

You can see the AJAX setting with "Form Submit" option.