From a20c1bb882d0736ea11b425f904912dca95f5d8d Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 20 Jul 2019 14:28:20 +0530 Subject: [PATCH] Add selectize to invite responsibles email validation and input as tags is added using selectize --- app/views/booths/_form.html.haml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/views/booths/_form.html.haml b/app/views/booths/_form.html.haml index dfce22b1..ab9080d3 100644 --- a/app/views/booths/_form.html.haml +++ b/app/views/booths/_form.html.haml @@ -29,4 +29,18 @@ plugins: ['remove_button'], minItems: 2 } ) + $('#booth_invite_responsible').selectize({ + plugins: ['remove_button'], + delimiter: ',', + persist: false, + create: function(input) { + if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(input)){ + return {} + } + return { + value: input, + text: input + } + } + } ) });