Selecting more than one value without checkboxes

Currenty I am using checkboxes to select more than one value in a form. So when creating a new post I can select all the categories it falls into. But the cat list is getting longer and is becoming a bit unmanagable.

enter image description here

Read More

I like how wordpress adds tags to each post via ajax. WordPress has a text input field with autocomplete, you just start typing and then if it’s already there (in the db) then it’ll show and get adding to a list dynamically. If it’s not found in the list then it gets inserted on form submit.

enter image description here

How can I achieve this or similar so that I don’t have to use x amount of checkboxes?

Related posts

Leave a Reply

2 comments

  1. One option would be to make use a library such as jquery-autocomplete
    https://www.devbridge.com/sourcery/components/jquery-autocomplete/

    This makes use of AJAX based functionality and will give you the ability to tweak it based on values stored in a database table. You can make a simple check function that, in the case the value can not be found, the user will have the option to simply press add and insert it into said library.

    The rest is jsut a matter of styling and design.