Lucee - cfinput autosuggest

#1

Hello,

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

The Lucee docs suggest this is supported:
http://docs.lucee.org/reference/tags/input.html

Code:

Anyone else use this autosuggest attribute?

Thanks!
Luke

#2

Hi Luke,

I use https://jqueryui.com/autocomplete/ instead. Maybe it helps?
Never used cfinput autoSuggest.
Regards
Thorsten

#3

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

#4

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

#5

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)

#6

have you seen horsey? https://bevacqua.github.io/horsey/

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

#7

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.

#8

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

#9

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

#10

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>
#11

You can pass in your own filter function