Skip to content

Commit

Permalink
gpadvs-remove-button-for-drop-downs.md: Added new combo snippet.
Browse files Browse the repository at this point in the history
  • Loading branch information
spivurno authored Nov 29, 2023
1 parent 904fb06 commit 29ee1d3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions gp-advanced-select/gpadvs-remove-button-for-drop-downs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Gravity Perks // Advanced Select // Show Remove Button for Drop Downs
https://gravitywiz.com/documentation/gravity-forms-advanced-select/

Advanced Select will automatically display a remove button for items in a Multi Select field. Use this snippet to activate a remove button for Drop Down fields too.

## Instructions

1. Install this snippet with our free [Custom JavaScript](https://gravitywiz.com/gravity-forms-custom-javascript/) plugin.

```js
gform.addFilter( 'gpadvs_settings', function( settings, gpadvs ) {
if ( gpadvs.formId == GFFORMID ) {
settings.plugins.remove_button = {
title:'Remove this item',
}
}
return settings;
} );
```

2. Add the following CSS via a `<style>` in an HTML field or wherever you include custom CSS.

```css
.gfield--type-select .ts-wrapper.plugin-remove_button .item .remove {
position: absolute;
border: 0 !important;
right: 2rem;
}
.gfield--type-select .ts-wrapper.plugin-remove_button .item .remove:hover {
background: none;
}
```

0 comments on commit 29ee1d3

Please sign in to comment.