Skip Navigation

[Resolved] Submit button not working

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

Problem:
After filling out m form I cannot submit it.
In Chrome a JS error is thrown:

An invalid form control with name='wpcf-book-image-1′ is not focusable. 

You cannot submit the form, until you delete the existing image, and re-upload a new one

Solution:
https://wp-types.com/errata/required-image-fields-cred-form-will-appear-not-set-re-upload-new-image/

This support ticket is created 6 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.

Our next available supporter will start replying to tickets in about 7.51 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 8 replies, has 2 voices.

Last updated by Beda 6 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#621531

I have: a custom post CRED edit form which was working

Link to a page where the issue can be seen: You need to be a logged in user to use this form

I expected to see: the updates applied when the submit button is clicked

Instead, I got: no action when the button is clicked.

The button is active - if I remove a required field the field error appears when the button is clicked. If everything is OK then nothing happens (that I can see). The form does not take the re-direct action or save the updates or send the notifications. It's as if it's not working.

I have removed the AJAX as per another bug post. I am running the latest version 1.9.5. I have disabled other plugins.
I have recreated the form with autocreate - same problem. I have tried this on various browsers. I have logged in as different users at different levels.

A similar set of forms to create and then edit a different CPT work fine. Only this one form has stopped working.

The form was working - I (and other users) have edited many Partner profiles (my CPT). I don't know exactly when it died but it must be fairly recent.

Any diagnostic ideas welcome. Many thanks.

#621670

I have removed the AJAX as per another bug post

Can you elaborate on this?
If you refer to disabling AJAX with Custom Code as it was suggested due to a conflict with Relevannsi, please re-check the related Erratum as it's updated:
https://toolset.com/errata/cred-auto-draft-posts-created-when-relevannsi-cred-and-featured-images-are-used/

If this is not what you meant, please can you elaborate what you mean with disabling AJAX, as there are several ways to do that, and where it has been suggested?

Related to the Form itself, it seems something is blocking the form from submitting.

This does not happen locally.

A similar set of forms to create and then edit a different CPT work fine. Only this one form has stopped working.

In this case, it may that:

- there is custom code applied just to that one form
- there is JS on just that one form
- the form simply is corrupt

==> Please try to duplicate the form and test it
==> Please try to create a new form of the same kind and test it

If all this fails, check if the issue also persists with a WordPress Default Theme and NO Plugins BUT the Toolset Plugins?

If not, could you then re-enable the Plugins one after the other, and check the issue each time you enable a plugin?
Please report me when the issue comes back
It might also be due to the Theme.
Please do reactivate your Theme only after you are sure the issue isn't coming from a 3rd Party Plugin.

Depending on the outcome of above tests, the issue will be either solved, or we will have a clear pattern of how to replicate it.

I suspect there is some JS in that form stopping it from submitting, or the erratum I shared is still applied with the workaround instead of with the patch.

Please let me know the results.

#622772

Hi Beda - apologies for the delay but I had to work on this. I have discovered the problem - more later. To confirm:

1. Disable AJAX - I only meant that I unchecked the box to allow AJAX on the form. Nothing more complicated.
2. I have disabled all plugins and stripped down to a basic system. I use GeneratePress as my theme.
3. I have re-created the form again (already did that but did it again) with no change.
4. Using Chrome developer panel, I found that the problem was an event error on Submit as follows:

An invalid form control with name='my-custom-field' is not focusable. This error means the validation is trying to tell me something but can't focus on the field item.

5. The custom field is for an image upload - which has worked perfectly before.
6. The form works OK if you remove the existing image and reload another one.
7. Removing the 'Required' property on this field also allows the form to function correctly.
8. I now know this same problem exists with the same image load on other forms.

So I figure that the custom field has become corrupt in some way. I would like to recreate it in Post Fields - but I worry that, if I remove the existing field, it will remove all instances of that custom field from the posts where it is used. I would have to reset all of them. Any other ideas welcome. The workaround to remove the 'Required' property has taken the pressure off as the site is now working again.

Many thanks.

#622911

This is rather strange.

Are there any steps that lead to this problem, or is this due to some other accidental issue on the site?

If this is replicable, we need to pay attention to this as it may be a bug.

As for recreating the field, you can do so and as long this field is not a complex field like a Checkboxes Field, you should be able to delete it and re-create it.

Only if you delete the Field in Toolset > Post Fields > Fields Control, then the data is as well deleted from the database.

Of course, such changes should be done only after a solid backup.

If you are sure this will solve the issue for you, and that the issue is due to some accidental hiccup, this may be the solution.

But I rather would suggest being on the safe side.

Is there a way to replicate this problem?
Or, eventually, you can show us a copy of this site, so we can take a look?
https://toolset.com/faq/provide-supporters-copy-site/

#624267

Hi Beda - apologies again for the delay. At the moment I only have the live site so I can only take it down for diagnostics at the weekend. I checked this weekend and the problem is still there - if I make the image a required field, the browser generates the same error. But I can see no reason why it should want to focus on that field. I'll do some more work and post back to you.

I can give you access to the live site after I've taken a backup if you're happy with that. Let me know if you're happy with that. Many thanks.

#624589

Why don't send me a duplicator package of the whole site?
I can then (according to your steps that you'll add) try to replicate locally, and eventually find the issue so to fix it.

Here is how you can share a copy of your site with me:
https://toolset.com/faq/provide-supporters-copy-site/

#625258

It seems a colleague was able to replicate an issue which as well produces the JS error as you see it.
https://toolset.com/forums/topic/cred_generic_field-setting-values-randomly-for-select-type/

I think it's the same issue, I will investigate this again and update you.

#625299

Hi Beda - thanks for spotting this. Yes, it does sound like the same problem. My own problem works the same way - my image field is required - but if I clear it, the form works fine, captures the empty (required) field and tells me to fix it; when I upload an image the submit works fine. However when I come to edit the form again (same form) it raises the error. However my field is never hidden - so there is no reason why the error "... cannot be focussed" should ever generate.

I suggest you ask Christian to use the Chrome developer tool to see what the error is generated when you hit submit - I guess it will be the same. My work around was to remove the 'required' flag from the field in Post Fields.

Let me know if you still want the duplicator version but I will wait to hear what happens here. Many thanks.

#732998

This issue is now resolved in the current CRED release which you can download in the Toolset Download area (Stable versions)