[Closed] Limit uploading number of repetitive images on a form

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.


This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 3 months, 3 weeks ago.

Assigned support staff: Christian Cox.


Hi, I want to limit the number of repetitive images on a Toolset form.

I tried to implemet the solution I found here:


I've added this code to my Form JS:

$('.js-wpt-repadd').click(function( e ) {
        var length = $('input[type="file"]', $(this).closest('.js-wpt-field-items')).length;
         if(length>=5) {

But I get this error:

Uncaught ReferenceError: SetDeleteEvent is not defined
at HTMLAnchorElement.<anonymous> (?typeid=33&form=editimages&listingid=3502:272)
at HTMLAnchorElement.dispatch (jquery.js?ver=1.12.4-wp:3)
at HTMLAnchorElement.r.handle (jquery.js?ver=1.12.4-wp:3)


Christian Cox

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Scroll back up on that page to see where the function SetDeleteEvent is defined: https://toolset.com/forums/topic/limit-number-uploading-files/#post-335096

There is no JavaScript API for Forms, so you're mostly on your own here. I can help with the PHP API for form validation in much more detail if you'd like to explore that.

The topic ‘[Closed] Limit uploading number of repetitive images on a form’ is closed to new replies.