⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to create tokenized input like Facebook, or multiselect-autocomplete?



Iszuddin Ismail
  • profile picture
  • Member

Posted 13 July 2017 - 02:24 AM

I am hoping that this has been developed by somebody, or is already supported.

 

What I need to do is have an autocomplete input, but is able to take in more than one answer. This is for keyword tagging, where users can tag one or more the keywords from another table, preferably by ajax.

 

If this has been done before, please point me to the right direction.

 

Otherwise, I think I need to make use of field callback to customize the field with Tokenized2 or something. https://zellerda.github.io/Tokenize2/index.html


Amit Shah
  • profile picture
  • Member

Posted 13 July 2017 - 04:41 AM

Well, this is surely possible. What you can do in here is a simpler version - create a N-N relation table and set it in GC .. this feature you will be able to create it by default.

 

If you dont wana go with N-N relation, then its a different call. Then you may need to create your own. What you need to do is simply create a field with its type set to select / Dropdown.

 

You can add required JS / CSS using set_js / set_css features of GC.

 

You also need to create your own piece of JS file which is going to handle the tokenization feature for the field.

 

Now Tokenize2 have an option to deal the same with Ajax.

https://zellerda.github.io/Tokenize2/config.html    -  The following link will help you check out the same. You can use that Ajax piece of code and get rolling.

 

Hope you arrive to your desired functionality.

 

Happy GCing :)


Iszuddin Ismail
  • profile picture
  • Member

Posted 17 July 2017 - 07:23 AM

Yeah ... I guess I'd have to do a field callback then. I roughly have an idea how to accomplish this. Just thought that perhaps this has been done by someone else. Maybe I'll share what I've done soon.