Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions gravity-forms/gw-prevent-duplicate-selections.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function output_script() {

<script type="text/javascript" defer>

jQuery( function( $ ) {
function process_duplicate_selections($) {
window.gform.addFilter( 'gplc_excluded_input_selectors', function( selectors ) {
selectors.push( '.gw-disable-duplicates-disabled' );
return selectors;
Expand Down Expand Up @@ -203,7 +203,14 @@ function gwDisableDuplicates( $elem, $group, selected ) {
}

}
} );
}

// Loading at the time of form loading.
jQuery( process_duplicate_selections );
// Loading when selections are updated via GP Populate Anything.
jQuery( document ).on( 'gppa_updated_batch_fields', function( event, formId, fieldIds ) {
jQuery( process_duplicate_selections );
})
</script>

<?php
Expand Down