Skip to content

Conversation

@netzgestaltung
Copy link

Hi there,

reference: https://wordpress.org/support/topic/cannot-add-a-new-field/#post-14035053

Problem:

I am trying to add a field to an existing field set. When I click “Add” next to Input Test as my field type, the page reloads, but I am not presented with the form to add my fields. I tried adding a new field set to see if I could add the field there, but the same thing happened.

Also, if I click Edit on an existing field, nothing happens.

the problem is inside the JS construction at /just-custom-fields/assets/just_custom_fields.js

before there was the old live function for the submit event handler of the “edit field” form. it took care of elements with the same selector to be attached to the event handler even if its created after the attachment (by an ajax call) which is the case here.

i encapsuled the event handler in a new seperate function jcf_init_edit_field apart from initFieldsetFields and added it to the promise handler of the ajax response jcf_show_ajax_container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants