alleyinteractive / alleyinteractive/wordpress-fieldmanager
Clear input value on Fieldmanager_Autocomplete
- Lingua principale
- PHP
- Stelle
- 563
- Fork
- 99
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### Description
Hi,
As far as I know, we don't have a way to prevent the user from selecting duplicate Posts when we use Fieldmanager_Autocomplete -> Fieldmanager_Datasource_Post.
I'm using a custom JS code where based on some rules, I apply this:
```
$(this).val('');
$(this).trigger('input').trigger('change');
$(this).blur().focus();
alert( 'This post is already selected. Please choose a different one.' );
```
That works fine (kind of). The input value is set to empty, even if the user saves any changes, duplicate records are no longer saved. However, even when the input value is empty, the title of the Post remains visible in the input.
Do we have a way to clear that Post Title from the input as well? or a way to trigger the remove record action?

Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.