I love how the dropdowns work in CF6, how I can either click the arrow to see the full list of options or just start typing and it will show me potential matches.
I would like to have a dropdown list where, if the user types something that has no match on the list, it is added to the top or bottom of the list for them to choose. I'm not sure if this would be done with the Event tab of the dropdown field or if some custom JS would be required. This would be for a dropdown with multi-select set to Yes, which I think makes it a bit more complicated.
Can anyone point me in the right direction?
EDIT: I just realized the dropdown field I was looking at has an autocomplete and that's why the functionality is so cool. I think that makes it still more complicated to do what I'm trying to do...
EDIT 2: I successfully modified the autocomplete to do this, but it only works if multi-select is set to No.
Here is the Custom Code I'm using:
I would like to have a dropdown list where, if the user types something that has no match on the list, it is added to the top or bottom of the list for them to choose. I'm not sure if this would be done with the Event tab of the dropdown field or if some custom JS would be required. This would be for a dropdown with multi-select set to Yes, which I think makes it a bit more complicated.
Can anyone point me in the right direction?
EDIT: I just realized the dropdown field I was looking at has an autocomplete and that's why the functionality is so cool. I think that makes it still more complicated to do what I'm trying to do...
EDIT 2: I successfully modified the autocomplete to do this, but it only works if multi-select is set to No.
Here is the Custom Code I'm using:
<?phpI'm just not sure how I would modify this so that it works with multi-select set to Yes.
$this->data['locations'] = $this->get("read_data11");
$this->data['locations'][$this->data("location")] = $this->data("location");
?>
{data/jsonen:locations}