Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear input value on Fieldmanager_Autocomplete #878

Open
jmolinanesn opened this issue Sep 11, 2024 · 0 comments
Open

Clear input value on Fieldmanager_Autocomplete #878

jmolinanesn opened this issue Sep 11, 2024 · 0 comments

Comments

@jmolinanesn
Copy link

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?

Screenshot 2024-09-11 at 5 19 15 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant