I just ran into an issue with tagit that excludes the select form element from being submitted when clearing a previously entered tag list. Has anyone else seen this issue? If so I'm curious to see the workaround. In the meantime I'll share mine below:
tagsChanged: function(tagValue, action, element) {
var tags = TFW.widget.Tag.getTags($("#"+tagListContainer).tagit("tags"));
if ($.isEmpty(tags)) {
$("select[name='"+tagFormInputField+"']").append('<option selected="selected" value=""></option>');
}
}
In a nutshell I'm simply adding an empty select option if the tag list has been cleared. Also, there's a bit of my own code such as $.isEmpty, which checks for empty string, and TFW.widget.Tag.getTags, which simply retrieves the tag list.
Hi everyone,
I just ran into an issue with tagit that excludes the select form element from being submitted when clearing a previously entered tag list. Has anyone else seen this issue? If so I'm curious to see the workaround. In the meantime I'll share mine below:
In a nutshell I'm simply adding an empty select option if the tag list has been cleared. Also, there's a bit of my own code such as $.isEmpty, which checks for empty string, and TFW.widget.Tag.getTags, which simply retrieves the tag list.
Thanks!