First of all, the
UI.autoComplete widget rocks, thank you so much. I had some ideas that were not implemented in your examples and thought I would share them in case they would be easy to add to the widget's core. I haven't tried coding these options myself, so I don't know if these suggestions are feasable or even within the scope of the widget, but I figured someone would have some input:
Item 1 -
options.multiple.autoAddbyKey (bool)
I was noticing that when entering multiple values, you have to click on the value you want to use if it pops up. I think it would be nice to be able to hit one of these keys to add the highlighted value to your input form:
- forward arrow -- enters the highlighted value in the field and waits for input to determine if a "," needs to be added. If it's the last entry and the user presses TAB for next field...don't put the comma, if the user starts typing after the forward arrow, suggest new value and enter comma space after last entry (see item 4 below)
- space --same as forward arrow (see item 4 below)
- comma -- different from the forward arrow and space bar input selectors, the comma would add the highlighted value AND the comma and space immediately following (see item 4 below)
- semicolon -- same as comma (see items 4, 5 below)
Item 2a - options.multiple.prohibitDuplicatesWhen entering multiple values into a single field, there should be an option to restrict multiple identical values. If I start typing "ja" and the list of options appears, I would like to press ",ja" to automatically add "java" to the input value along with a comma and space and then autoSuggest "Javascript" would appear--not "Java" again.
item 2b- options.multiple.removeEnteredIn other words, there should be an initialization option that eliminates existing values from the suggested dictionary. In fact, the ideal implementation would automatically remove any tokens whether manually entered or autoComplete entered.
Item 3 - options.multiple.forceSep, options.multiple.definedSepWhen entering multiple values, you should be able to add a default token separator. In other words, if the programmer needs comma separated values, the default token separator should be set to comma (space). If semi-colons should be used, you should be able to setup options to automatically convert commas into semi-colons as entered.
Item 4 - options.prohibitBlanksYou may already do this, but you should check the input for trailing separators or blank separators as needed. In other words, if your separator is a comma, you should have the option of restricting input so that the user can't enter "comma comma" or "comma space comma" Also, if the field ends in space, strip it. If it ends in comma space (or token separator space) remove both when advancing to next field.
Item 5 - options.multiple.autoAddintelligentWhen selecting an option from the autocomplete field, the value should be added to the input and a listener should check for additional keyboard input before inserting the separator character. A list of acceptable separators could be defaulted and predefined, but unified. In other words the following make good separators: comma, semicolon, colon, period, space and an option to auto-replace with preferred token separator should be added.
I
tem 6 - options.multiple.encaseSpace, options.multiple.forceEncase, options.multiple.definedEncase{prefix, suffix}An option to restrict space characters in multiple input should be added even if the token separator is not set to space. However, if autocomplete has options defined with spaces in them and this option is set, the autoinserted value should be encased in quotes.This should also be optional.
Summary:
- options.multiple.autoAddbyKey (bool)-automatically adds highlighted value using keyboard
- options.multiple.prohibitDuplicate (bool)-do not let duplicate values be added to multiple input fields
- options.multiple.removeEntered (bool) -- remove entered values from the popup selection
- options.multiple.forceSep (bool)-- automatically changes separators into the default separator
- options.multiple.definedSep - (string) --the required separator, if defined automatically sets the useDefinedSep to true if not otherwise declared
- options.multiple.prohibitBlanks (bool) -- checks input for blank entries or repeated separators
- options.multiple.autoAddintelligent (bool) -- if set to true, will only add the separator when appropriate, if set to false, will automatically add the separator upon autoselect (value set to true if useDefinedSep is set to true)
- options.multiple.prohibitSpace (bool) - does not allow multiple items to contain space characters
- options.multiple,removeSpaceSuggest (bool) - automatically removes any dictionary items containing spaces if prohibitSpace option is set - overrides encase options
- options.multiple.encaseSpace (bool) -- prohibitSpace is set to true, this option automatically encases entries between separators in quotes. It also adds quotes to dicitionary items that contain spaces if removeSpaceSuggest is set to false
- options.multiple.forceEncase (bool) automatically add default encase characters to multiple inputs
- options.multiple.definedEncase (object) - if forceEncase is set to true, automatically add these tags to multiple entries.
- options.multiple.definedEncase.prefix (string) - if forceEncase is set to true, automatically add this to the beginning of every entry
- options.multiple.definedEncase.suffix (string) - if forceEncase is set to true, automatically add this to end of every entry
I will be working on trying to encode these as my own plugin, but having never written a plugin for jQuery, I suspect it will take me a lot longer than anyone who knows jQuery inside out.
If these options do not belong in the UI.autoComplete widget core and somebody develops a plugin that enables these features, please please let me know.
Thank you for having these forums and for reading my post. Best wishes, jase