How to prevent duplicate selection of items in the pull-down

[ad_1]

Hello @tsubakuma

The plugin does not include a specific feature for this case, but you can emulate it from the form.

I’ll assume there are three dropdown fields in the form: fieldname1, fieldname2, and fieldname3. You can insert an “HTML Content” field in the form with the following piece of code as its content:


<script>
jQuery(document).on('change', '[id*="fieldname1_"], [id*="fieldname2_"], [id*="fieldname3_"]', function(){
let e = jQuery(this), v = e.val();

jQuery('[id*="fieldname1_"], [id*="fieldname2_"], [id*="fieldname3_"]').each(function(){ if(this != e[0]) jQuery('option[value="'+v+'"]', this).prop('disabled', true);});

});
</script>

Note it is a simple example of the process. If you need a more complex process with other validations or removing the items from the list instead of deactivating them, you can request a custom coding service directly on the plugin’s website: contact us

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer