Skip Navigation

[Resolved] Edit custom fields in a single from for all posts simultaneously

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

Problem:

The issue here is that the user wanted to edit a single custom field on their posts in a list without going to the post page itself.

Solution:
To resolve this you can create an edit post form and set it to submit using AJAX. Then removed all the fields that aren't needed leaving only the needed field and the submit button.

Finally just add that form to the view listing out your posts. From there you can Edit the Field A and change the values for each of the posts without having to go to the post itself. You can edit the fields from the list.

This support ticket is created 2 years, 9 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)

This topic contains 4 replies, has 2 voices.

Last updated by joostH-2 2 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#2090647

I have a CPT "guests" with (a.o.) a custom field "chair_number". I want to create of form, listing all guests with there respective chair number, and have the ability to edit the chair number in that listing. I already have a view with all guests and chair numbers. I could add edit links, that lead me to the respective guest forms, where I can edit the chair number. So far, so good.

But that is not what I want. What I want is that I can simultaneously edit the chair number in the list itself, for all guests, without going to an individual guest form. Is that possible? If so, could you give me a pointer?

#2090901

Shane
Supporter

Languages: English (English )

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

Screenshot 2021-06-16 at 2.14.21 PM.png

Hi Joost,

Thank you for getting in touch. Have a look at my screenshot.

Does this look similar to what you want to achieve?

What I did was to create an edit post form and set it to submit using AJAX. Then I removed all the fields that weren't needed leaving only the needed field and the submit button.

Finally I just added that form to the view listing out my books. From here I can Edit my Field A and change the values for each of the posts without having to go to the post itself. I can edit the fields from the list.

Please let me know if this helps.
Thanks,
Shane

#2091217

Hi Shane,

Thanks for your prompt reply. That comes very close indeed. I see what you do: you create a view that includes a set of mini-forms, while I was thinking the other way around: create one single form including a view. I got your approach working quickly.

A small drawback for me is that I now have to submit the edits one by one. Actually, this is part of a game competition site where participants are perhaps watching the result page eagerly for the update. So, one single update for the whole page would be more sophisticated. Is that something that is possible as well? But frankly, that's a nice-to-have feature. Your solution would also work.

One small question: is there a standard means to eliminate the repetitive field label (in your example Field A), or should I remove that via CSS?

Thanks!!!

#2091625

Shane
Supporter

Languages: English (English )

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

Hi Joost,

Happy I was able to provide a workable solution for you.
So, one single update for the whole page would be more sophisticated. Is that something that is possible as well?

Actually no given that they are individual forms they will need to be submitted individually.

One small question: is there a standard means to eliminate the repetitive field label (in your example Field A), or should I remove that via CSS?

Yes you can with the use of CSS. just add the custom css to the form CSS section and it should hide the labels for all the fields that it targets.

Thanks,
Shane

#2093573

Thanks Shane. The solution you provided works for. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.