Skip Navigation

[Resolved] Two forms on a page. Image removed when one form updated

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

Last updated by Mario 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1243150
LC-profile-update.png

Tell us what you are trying to do?
I have two forms on a page both (Editing existing content) one has an image.

When a change is made (updated) to the form (form2) without the image.
The page reloads and the form (form1) that contained the image - the image is removed. All other data is retained.

to see the page
you will needed to login as a user
hidden link

hidden link

#1243382

Hello,

The problem you mentioned above is abnormal, please try these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

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

#1249723

Yes will get it over to you over the weekend.

#1250565

Please update this thread if you need more assistance for it, and I have enabled the private message box again, in case it is needed.

#1251459

Thanks for the details, I am downloading the files, will update here if there is anything found

#1251489

Here are what I found, in the URL you mentioned above:
hidden link

There are two post forms:
- carer-update-image-desc1-fu1(ID: 1711)
- carer important info update dash (ID: 1862)

There is a same image field "provider-image" in both above forms, both post forms are editing same post.

If you submit the second form without the image value, it will reset "provider-image" field value to empty, so it is expected result as you mentioned above:

When a change is made (updated) to the form (form2) without the image.
The page reloads and the form (form1) that contained the image - the image is removed.

In your case, I suggest you remove the "provider-image" image field from second post form "carer important info update dash", then when user submit the second form, it won't reset "provider-image" field value, and author users can only update the image field in the first post form: carer-update-image-desc1-fu1

#1252125

Hi Luo

I have removed the second image from the form. when updating any of tab forms the image is removed when the page reloads.

#1252523

I have tried similar setting in my localhost with a fresh wordpress installation + the latest version of Toolset plugins, but there isn't similar problem, I am trying to dig into your duplicator package, will update here if there is anything found.

#1252591

I can duplicate the same problem in my localhost with a fresh WordPress installation, it happens when I submit the second form, and it takes effect on image field of first form.

I have escalated this thread, our developers will take care of it.

Currently, I suggest you try to enable the AJAX submitting option in second edit form, for example:
Edit the post form "carer important info update dash", enable option: Submit this form without reloading the page (use AJAX)
And test again.

#1255287

Thank you Luo for your help.

My issue is resolved now. Thank you!