Modifying events on an autopicker with tags

Modifying events on an autopicker with tags

by Bobby Wenman -
Number of replies: 1

Hello everyone,

I am using the autocomplete element from the Moodle Form API on a Moodle form. I preload the autocomplete element with a list, set multiple to true, and tags to true. This allows the user to add elements to the list if they don't already exist. A user can add an element by typing in the text and either clicking enter or clicking off of the autocomplete element. This event will take whatever the text is in the autocomplete and add it to the list. I don't want an element to be made every time the user has entered text and clicks off of the autocomplete, rather just when the user has entered text and clicks enter. Is there a way to do this using Moodle's Form API autocomplete or should I go about this a different way?

tl;dr Can I remove the click off event that the autopicker with tags uses to add elements to the list?

Average of ratings: -
In reply to Bobby Wenman

Re: Modifying events on an autopicker with tags

by Bobby Wenman -

I ended up copying the autopicker.php into my own file so I could edit the events how I wish. This way I can just use this new file to make a new tool instead with the events that I want.