diff --git a/index.html b/index.html
index cab5e59..c52fff7 100644
--- a/index.html
+++ b/index.html
@@ -242,6 +242,14 @@
Vue
+ Add items if they don't exist
+
+ England
+ Wales
+ Scotland
+ Northern Ireland
+
+
Below is an example of how you could have two select inputs depend on eachother. 'Boroughs' will only be enabled if the value of 'States' is 'New York'
States
@@ -460,6 +468,11 @@
}
});
+ var singleAddItems = new Choices('#choices-single-add-items', {
+ addItems: true,
+ duplicateItems: false,
+ });
+
var customTemplates = new Choices(document.getElementById('choices-single-custom-templates'), {
callbackOnCreateTemplates: function (strToEl) {
var classNames = this.config.classNames;
@@ -498,6 +511,16 @@
}
});
+ var states = new Choices(document.getElementById('states'), {
+ callbackOnChange: function(value) {
+ if(value === 'New York') {
+ boroughs.enable();
+ } else {
+ boroughs.disable();
+ }
+ }
+ });
+
var boroughs = new Choices(document.getElementById('boroughs')).disable();
});