Support » Plugin: CMB2 » An invalid form control with name=’…’ is not focusable.

  • I’m having this ackward behaviour in a website I manage.

    We have a custom post type Courses. We manage each course’s data through some metaboxes built with CMB2. We have a repeatable group to manage venue and date pairs. It works great. Except in one course, where we can’t save the (new) dates using Chrome or Firefox (I did manage to save the dates with Safari 9.1.2).

    Looking at Chrome’s console I see this error:

    An invalid form control with name='…' is not focusable.

    I can’t figure out what’s the issue and why it targets only one of the courses and not all.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Can you provide your CMB2 config so we can see if we can reproduce? Also any information about the rendered field(s) in question for the actual markup used may provide insight.

    I’m using a functionality plugin to create custom post type, custom taxonomy, and custom fields using CMB2. The custom fields are being created using this code.

    Also using some CMB2 extensions: Conditionals, Tabs and Attached Posts.

    The error occurs only in 1 of 14 published course posts.

    Not sure if this is what you’re looking.

    Thanks.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmmm. First thing I’d end up doing is disable the plugins one by one until the error goes away, and then check if it comes back once re-activating. If yes for both parts, then we know the source of the issue as a whole, and the proper support can be reached out to. Given that we have 3 extensions on top of CMB2 core in play, it’s possible that it’s not necessarily CMB2 core’s source that’s the issue here.

    OK, I’ll do just that and post my findings here.

    Thanks Michael.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

    I found it: there was a field in need of attention… The tabs interface was masking the issue and we couldn’t see the field was blank. The strange thing is this was only happening with 1 course post, which is odd.

    The field in question was, in fact, added after the course post was created, but applies to all course posts. So I’m still puzzled by the error.

    Thank you for your help.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    This tabs addon doesn’t create new fields/field types correct? It just collects what ones you make and does its thing to group them together?

    Asking cause I’m curious which field specifically it is, from what you provided above to see if there’s something odd about its declaration as well.

    You’re right. Tabs addon just groups fields in a tabs interface, like this: https://cloudup.com/cQQf9j1th7i

    Line 357 of this file is where the problematic field is defined, course_monthly_fee_intensive. The following field, course_installments_intensive has the data-conditional-id attribute defined. Can this be the problem?

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    While I can’t say for certain, it definitely could be contributing. I could see issues coming up from somehow trying to select something that is either hidden, or something else due to the conditional nature of the setup.

    Perhaps try removing that conditional parts and see if the error goes away then. Just have them all show.

    Yes, that’s probably the safest solution. Thanks Michael.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.