I need to limit the number of images in the custom field image gallery
Could you help me?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Thank you for getting in touch.
A formal feature request has been made for this already, however what I can do is to add your ticket to this feature request.
Currently the only way to do this is to use custom code to achieve this. Is this for the frontend or backend ?
For the frontend you can try using the code in the link below.
https://toolset.com/forums/topic/limit-number-of-multiple-instance-fields/#post-200364
Thanks,
Shane
In the front end.
The code on it doesn't work for me, maybe I'm not putting it right.
jQuery(function( $ ) {
$("a.galeria_imagenes").click(function( event ) {
$length = $('div.galeria_imagenes-field').length;
if($length>=5)
{
$("a.galeria_imagenes-field").hide();
}
})
});
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Can you provide me with a link to the form on the frontend so that I can have a look ?
If the form requires login then you can provide the credentials in the private fields.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hello,
Try using this code here
jQuery(function( $ ) {
$("a.js-wpt-repadd").click(function( event ) {
$length = $('.galeria_imagenes .wpt-repctl').length;
if($length>=6)
{
$(".galeria_imagenes a.js-wpt-repadd").hide();
}
})
});
This should work now as i've tested it on your frontend and it works fine.
Thanks,
Shane
My issue is resolved now. Thank you!