Skip Navigation

[Resolved] Custom dropdown field bugged

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

Problem:

Use Types plugin to setup some required custom fields, but get JS errors when click the "Update" button, for example:

An invalid form control with name='wpcf[monday-schedule-duration-from]' is not focusable
An invalid form control with name='wpcf[monday-schedule-duration-to]' is not focusable

Solution:

Remove the custom field "required" setting and test again

Relevant Documentation:

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

Last updated by hendrikH 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#890876
custom dropdown.jpg

Hello,
So i have this dropdown field in "Guided Bike Tours" post types named "Duration", in which the user can select between "Single-day tour" or "Multi-day tour". With the help of this dropdown some other custom fields are shown/hidden (for multi-day tour option) and also the posts are filtered in other views. This dropdown is mandatory for post publish.

I've encountered this bug: If i create a post with the dropdown selected on either one of the options, i cannot change the value of it at any point after. If i try to change the value of the dropdown the "Update" button of the post simply does not save,update or refresh the page.

Admin credentials below.
PS: This is the live site as i don't have the conditions to create a staging.

Thank you!

#891543

Hello,

Thanks for the details, I can login your website.

Here is detail steps I tried, please correct me if there is anything missing
1) Dashboard-> Guided Bike Tours-> Add new(or edit an existed post)
2) Fill post title,
3) field "Duration" choose option "Multi-day tour"
4) fill all other required fields ,for example:
Metres of Elevation*
Length*
...
click button "Publish", I can see the new post is saved correctly, for example:
hidden link
hidden link

There isn't similar problem as you mentioned above:
If i try to change the value of the dropdown the "Update" button of the post simply does not save,update or refresh the page.

#892026

Hello and thank you for the quick reply.

Ok, now on the published post try to change the value of the "Duration" field and Update the post.
For example:
on this post: hidden link
try to set duration to: "Single-day tour".
For me if i try to change the value of this field on this published posts, the Update button is not working.

Best regards.

#892135

Thanks for the details, I can see the problem you mentioned above, and I see a lots of JS errors when click the "Update" button, for example:

An invalid form control with name='wpcf[monday-schedule-duration-from]' is not focusable
An invalid form control with name='wpcf[monday-schedule-duration-to]' is not focusable

It is abnormal, in case it is a compatibility problem, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL, I need to test and debug it in my localhost, thanks

#899944
#900162

Thanks for the details, I can duplicate the same problem in my localhost, the problem is in the custom field group "Weekdays Schedule"
hidden link

You have setup those fields as required:
- monday-schedule-duration-from
- monday-schedule-duration-to
...

But in the problem post:
hidden link
You did not setup the value of above fields, then it trigger the JS errors as I mentioned above.

And in your website settings, there are lots of complicated condition, I suggest you disable those the "required" for those custom fields:
- monday-schedule-duration-from
- monday-schedule-duration-to
...
and test again.

#901422

Hello,
I have unchecked the "required" options for the weekdays schedule fields, and the bug dissapeared.
Thank you.

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