Lucee - cfinput autosuggest

Hello,

We have a piece of code which is throwing the error:
attribute [autosuggest] is not supported

The Lucee docs suggest this is supported:

Code:

Anyone else use this autosuggest attribute?

Thanks!
Luke

Hi Luke,

I use Autocomplete | jQuery UI instead. Maybe it helps?
Never used cfinput autoSuggest.
Regards
Thorsten

The OP was referring to cfinput, at the link provided. Autosuggest is referred to there, and as the OP has stated does not work, and doesn’t work many years later today. The reference does not indicate any obsolescence or deprecation.

The jqueryui.com autocomplete is not quite the same thing as autosuggest. How would one make it first-character sensitive?

image

Do you mean with jquery UI or the old cfinput code?

Lucee doesn’t support autosuggest despite what the documentation states but I’d like to have something, perhaps jqueryui stuff, give the first-character sensitivity that ColdFusion can do.

(and if possible, allow commas and apostrophes to be part of the suggest)

have you seen horsey? horsey

I have filed a bug about the documentation describing unsupported attributes
https://luceeserver.atlassian.net/browse/LDEV-2281

No but thanks. Checked the horsey link. It still isn’t first-character sensitive. Enter an “e” for first character. It matches to apple and orange.

The code is listed there. Is there something in there that I can modify or add that will limit to the start of the data list items (e.g. name)? Dread, but I suppose the download with the .js is where it would need to be changed.

Thanks for the bug report too.

The jquery ui docs have an example at the bottom of autosuggest on how to do it.
https://api.jqueryui.com/autocomplete/#event-select

Crap. I didn’t finish scrolling to the end. That’s it. Thanks for showing me.

Script function block needs to be after cfform as:

<cfform action="index.cfm" method="post" name="f1"> 
                  <cfinput 
                        type="text" 
                        name="s_name"
                           id="auto1""> 
</cfform>
<script>
var tags = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" ];
$( "#auto1" ).autocomplete({
  source: function( request, response ) {
          var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
          response( $.grep( tags, function( item ){
              return matcher.test( item );
          }) );
      }
});
</script>

You can pass in your own filter function