You are viewing limited content. For full access, please sign in.

Question

Question

Javascript entry that allows for AutoSuggestion on a Multi-Line Field

asked on October 22, 2020

I would like to know if anyone has a script for LaserFiche that allows for AutoSuggestion on a Multi-Line Field.

This would make it easier for the text in the auto suggestion to be read.

0 0

Answer

SELECTED ANSWER
replied on November 4, 2020

Hi There

Here is some basic code that will allow for AutoSuggestion in your Multi-Line field;

1.) Assign CSS class to your multi line field, 'tags'

2.) Copy paste this code into your JavaScript section on Forms:

$(document).ready(function () {
  
  $(function () {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    
    $('.tags textarea').autocomplete({
      source: availableTags
    });
  });
});

3.) Start typing!

Result:

If you want your suggestion to be something else, simply edit the array:

var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];

You can even go as far as to populating this array with a custom data source.

Cheers.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.