mirror of
https://github.com/wahyd4/jQuery-Tags-Input.git
synced 2026-08-09 04:46:44 +10:00
Update jQuery version
Fix small problem with tagExist
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="http://xoxco.com/projects/code/tagsinput/jquery.tagsinput.css" />
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
|
||||
<script type="text/javascript" src="jquery.tagsinput.js"></script>
|
||||
|
||||
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js'></script>
|
||||
@@ -79,6 +79,6 @@
|
||||
<input id="tags_2" type="text" class="tags" value="php,ios,javascript,ruby,android,kindle" /></p>
|
||||
|
||||
<p><label>Autocomplete:</label>
|
||||
<input id='tags_3' type='text' class='tags'></p>
|
||||
<input id='tags_3' type='text' class='tags' /></p>
|
||||
|
||||
</form>
|
||||
+5
-6
@@ -96,7 +96,7 @@
|
||||
|
||||
var skipTag = false;
|
||||
if (options.unique) {
|
||||
skipTag = $(tagslist).tagExist(value);
|
||||
skipTag = $(this).tagExist(value);
|
||||
if(skipTag == true) {
|
||||
//Marks fake input as not_valid to let styling it
|
||||
$(settings.fake_input).addClass('not_valid');
|
||||
@@ -185,11 +185,10 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
$.fn.tagExist = function(val) {
|
||||
|
||||
var settings = $(this).data('settings');
|
||||
var tagslist = $(this).val().split(settings.delimiter);
|
||||
return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
|
||||
$.fn.tagExist = function(val) {
|
||||
var settings = $(this).data('settings');
|
||||
var tagslist = $(this).val().split(settings.delimiter);
|
||||
return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
|
||||
};
|
||||
|
||||
// clear all existing tags and import new ones from a string
|
||||
|
||||
Reference in New Issue
Block a user