aboutsummaryrefslogtreecommitdiffstats
path: root/demos/autocomplete
diff options
context:
space:
mode:
Diffstat (limited to 'demos/autocomplete')
-rw-r--r--demos/autocomplete/combobox.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html
index f74f0f106..fd373f0e4 100644
--- a/demos/autocomplete/combobox.html
+++ b/demos/autocomplete/combobox.html
@@ -11,6 +11,7 @@
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
<script src="../../ui/jquery.ui.autocomplete.js"></script>
+ <script src="../../ui/jquery.ui.tooltip.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.ui-button { margin-left: -1px; }
@@ -66,8 +67,10 @@
});
if ( !valid ) {
// remove invalid value, as it didn't match anything
- $( this ).val( "" );
- select.val( "" );
+ $(this).val( "").attr( "title", value + " didn't match any item" ).tooltip( "open" );
+ setTimeout( function() {
+ input.tooltip( "close" ).attr( "title", "" );
+ }, 2500 );
input.data( "autocomplete" ).term = "";
return false;
}
@@ -106,6 +109,12 @@
input.autocomplete( "search", "" );
input.focus();
});
+
+ input.tooltip( {
+ position: {
+ offset: (this.button.width() + 5) + " 0"
+ }
+ }).tooltip( "widget" ).addClass( "ui-state-highlight" );
},
destroy: function() {