Skip Navigation

[Resolved] CRED forms do not submit

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

Problem:
Hitting the Submit button on a CRED form, nothing happens.

Solution:
The client has custom JS to modify form fields before submission and the code includes preventDefault(), which is unnecessary and prevents the form submitting.

This support ticket is created 6 years, 5 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by y.S 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#586834

y.S

I try to edit an already saved entry from a frontend CRED form.

You will have to log in to see the issue.

I expected the click of the SEND button to result in a save operation.
Instead, nothing happens.

I am aware other tickets are open due to CRED form issues, but they don't seem to relate to editing entries.
Also I am not using AJAX, so that is not the issue.

#586966

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

It doesn't sound related to any of the open CRED issues, so let me take a look.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes other than possibly to temporarily add a backup plugin to take a snapshot of the site.

Can you confirm which form and where to access it on the front end?

Before this though, can you please do the standard check for conflicts and deactivate non-Toolset plugins and switch to a theme such as twentyseventeen and confirm that the issue is still present.

Thanks

#587093

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Thanks for the access credentials.

I looked at the form in question and see that you have custom JS added to the submit event that uses preventDefault(), so the form in question will never be submitted.

I removed the JS and the form worked as expected.

(I have re-instated the JS now so the form is not working currently.)

#587282

y.S

Hi Nigel,

The idea behind preventDefault() is to postpone the submit action.
This is needed because I want to transfer some values to other fields before submitting.
By ending the function with 'return true' the form is submitted eventually.

I use the same JS in the "add new entry" form and that one submits fine.

#587494

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

I edited the JS in your form to remove the preventDefault (and the return true), as it is not needed if you want to modify a field when the form submits.

I then tested the form on the page /melding-wijzigen/ and edited the first entry successfully. You'll note that I changed the status from Open to Opgelost.

#587512

y.S

Thanks. Kind of weird that it does work when adding new data, but it seems to work.

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