Support Forum ยป User Profile

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Disable select option #6206
    funkatronicfunkatronic
    Participant

    Can you post your code so I can experiment with what you are trying to do?

    in reply to: Disable select option #6171
    funkatronicfunkatronic
    Participant

    I just added a new commit on GitHub. The change event now includes a second argument, which contains all of the hidden inputs. This will allow you to count them to see if any are selected:

    
    jQuery('.rwmb-file_upload').on( 'change', function( event, items) {
        if ( items.length ) {
          //code here
        }
      });
    
    in reply to: Disable select option #6170
    funkatronicfunkatronic
    Participant

    @woorise Your solution has a flaw; you check if the result is empty by checking the length. This should work:

    
    jQuery('.rwmb-file_upload').on( 'change', function() {
        var uploaded = jQuery('.rwmb-media-input');
        if ( uploaded.length ) {
          //code here
        }
      });
    
    in reply to: Disable select option #6169
    funkatronicfunkatronic
    Participant

    Just to be sure, you want to know when files are added or removed?

Viewing 4 posts - 1 through 4 (of 4 total)