Skip to content

Clear input value on Fieldmanager_Autocomplete #878

Open
@jmolinanesn

Description

@jmolinanesn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions