I am using a template that comes with a nice Tags Input, but I now want to be able to count the number of words and limit the number of words based on certain criteria, however, the only way I've found to do this is by using keyup of the specific textboxfor, but to do this I need to reference to JQuery, but then it breaks my tags input. Below is what I currently have:
@Html.TextBoxFor(model => model.EmploymentSkills, new { @id = "tags", @class = "form-control tagsinput", @type = "text", @placeholder = "Add skill and press enter", data_role = "tagsinput" })
<script src="~/SmartAdmin/scripts/plugin/bootstrap-tags/bootstrap-tagsinput.min.js"></script>
Is there a way I can do this with out referencing to JQuery, or able to reference to it and not break my tags input ?
So I found a solution to this. As mentioned above, the .keyup or .keydown didnt work, so I landed up using .change. This is the function I used, also counting the number of words and limiting them:
$(document).ready(function () {
Hope this helps anyone else somewhere along the line.