Error in custom JS

Forums Autocomplete Error in custom JS

This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 2 years, 8 months ago.

  • Author
    Posts
  • #7148

    Ahmed Traore
    Participant

    I added the code to the custom JS of DFFS. But I have the error message below :

    There is an unspecified error in the Custom JS in the Misc tab. Please enter setup and revise

    Below is the code I added

    spjs.ac.textField({
    “applyTo”:”test”,
    “helpText”:”Project name or number…”,
    “listGuid”:”Adresses”,
    “listBaseUrl”:””,
    “showField”:”Ville”,
    “rowLimit”:5,
    “listOptionsOnFocus”:false,
    “reValidateOnLoad”:false,
    “setFields”:[]
    });

    Thanks for your help

  • #7149

    Alexander Bautz
    Keymaster

    Hi,
    The code looks good, but I suspect you have not referred the script file with the autocomplete solution in your DFFS frontend CEWP.

    Alexander

    • #7150

      Ahmed Traore
      Participant

      Hi Alexander,

      Thanks for your prompt reply. I did refer the script file. See my DFFS frontend CEWP code :

      <link type=”text/css” href=”https://intranet.medaudio.ca/DFFS%204255/DFFS_Frontend.css” rel=”stylesheet”>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/jquery-1.6.4.js”></script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/spjs-utility.js”></script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/spjs_autocomplete_min.js”></script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/SPJS-Casc_min.js”></script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/spjsrm_min.js”></script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/vLookup_frontend_min.js”></script>
      <script type=”text/javascript”>

      var spjs_license =”972-06510410910110003xxxxxxxxxxxxxxxxxxxxxxxx”;
      var spjs_dffs_backend = “https://intranet.medaudio.ca/DFFS%204255/DFFS_Backend.aspx”;

      </script>
      <script type=”text/javascript” src=”https://intranet.medaudio.ca/DFFS%204255/DFFS_Frontend_min.js”></script>

  • #7151

    Alexander Bautz
    Keymaster

    Please verify that the script src is correct, and if it is, try moving the code to the CEWP (below the last script tag where) like this:

    <script type="text/javascript">
    function dffs_Ready(){
    spjs.ac.textField({
            "applyTo":"test",
            "helpText":"Project name or number...",
            "listGuid":"Adresses",
            "listBaseUrl":"",
            "showField":"Ville",
            "rowLimit":5,
            "listOptionsOnFocus":false,
            "reValidateOnLoad":false,
            "setFields":[]
    });
    }
    </script>

    Then bring up the developer console (hit F12 > console) and look for errors.

    Alexander

You must be logged in to reply to this topic.