Skip to main content

Bug Tracker

Side navigation

Ticket #2836: jquery.autocomplete.js.diff


File jquery.autocomplete.js.diff, 0.5 KB (added by garrettmoon, May 09, 2008 06:14PM UTC)

jquery.autocomplete.js diff

--- jquery.autocomplete.js
+++ (clipboard)
@@ -218,6 +218,11 @@
 		
 		var currentValue = $input.val();
 		
+		if (options.allowedChars != ''){
+			var reg = new RegExp('[^' + options.allowedChars + ']', 'g');
+			currentValue = currentValue.replace(reg, '');
+		}
+		
 		if ( !skipPrevCheck && currentValue == previousValue )
 			return;
 		
@@ -382,6 +398,8 @@
 	formatMatch: null,
 	autoFill: false,
 	width: 0,
+	allowedChars: '',
 	multiple: false,
 	multipleSeparator: ", ",
 	highlight: function(value, term) {

Download in other formats:

Original Format