Support Forum
Support › Meta Box Group › Cloning Max 2
I been having this issue for quite some time now, and not sure if it has to do with the latest update that broke the Cloning ability.
My issue is that when the Max number of clones
is set to 2, then the "Add More" button does not appear. I would fix that in JS by clicking the remove-clone element.
const removeCloneElem = document.getElementsByClassName('remove-clone');
removeCloneElem[0].click();
This works but then for some reason my responses are all shifted.
<input type="text" required="1" id="group_1_color" class="rwmb-text" name="group[1][color]" aria-labelledby="group_1_color-label">
There is no starting from 0. Not sure what is causing this. Thank you for any help!
Just noticed the same
Hello Rod,
The issue is related to this topic https://support.metabox.io/topic/metabox-5-10-0-metabox-aio-1-30-0-max_clone-issue/
our development team is working on this issue and the fix for this issue should be included in the next update of MB plugins.
Hmm, I updated the plugins, and the issue persists. This time, it has to deal with the HTML:
<input type="text" required="1" id="rpi_stones_group_info_1_stones_full_name" class="rwmb-text" name="stones_group_info[1][stones_full_name]" aria-labelledby="stones_group_info_1_stones_full_name-label">
How come it is starting at index 1 and not 0?
The error of my console comes out as:
The invalid form control with name=‘stones_group_info[0][rpi_stones_full_name]’ is not focusable
.
Sorry, it's
<input type="text" required="1" id="stones_group_info_1_stones_full_name" class="rwmb-text" name="stones_group_info[1][stones_full_name]" aria-labelledby="stones_group_info_1_stones_full_name-label">
and
The invalid form control with name=‘stones_group_info[0][stones_full_name]’ is not focusable.
Hello,
If you open the Inspect tool of the browser and check the HTML structure, the index 0 is added to the clone template. And the index 1 is added to the field where you input the value.
This is the new feature of the cloneable field, so please update your code accordingly.