3 Replies Latest reply on Jun 11, 2007 12:29 PM by MergeThis

    Script Character Limitation

    RonShahar
      I wrote a small script to use two drop down list boxes and a text box to give answers depending on the choices from the 2 listboxes. There are 1250 combination of "else if". However, when I cut and paste the info into the small red box (script) it will only let me input a certain number of characters.

      Is there a way to increase that? Or can I have more then one script linked? I am new to both programming and RoboHelp and any help is appreciated.

      Thanks,
      Ron
        • 1. Re: Script Character Limitation
          MergeThis Level 4
          I think you'd be better off keeping the script inside an external .js file, which you can then link to from any topic you want.


          Good luck,
          Leon
          • 2. Re: Script Character Limitation
            RonShahar Level 1
            Thank You very much.

            This might sound foolish, but I might have over estimated my programming knowledge. I am very new to programming and my role here at my company. My IT dept wrote a simple script to reference the 2 list boxes and depending on the results display that in the text box. They do not know how to create and call a .js file.

            How do I code the script to reference the .js file? Any help would be greatly appreciated.

            Here is the script I have that is currently inside the red box in RoboHelp:

            function FindOut()
            {
            var L1 = document.getElementById("s1");
            var L2 = document.getElementById("s2");
            var TA1 = document.getElementById("t1");

            var str1 = "";
            var str2 = "";
            var str3 = "";

            if ( L1.selectedIndex >= 0 && L2.selectedIndex >= 0 )
            {
            str1 = L1.options[L1.selectedIndex].text;
            str2 = L2.options[L2.selectedIndex].text;

            if ( str1 == "Individual" && str2 == "Individual")
            str3 = "Both I"

            else if ( str1 == "Individual" && str2 == "Corporate")
            str3 = "I and C"

            else
            str3 = "The Common Answer for 95% of cases";

            TA1.value = str3;
            }
            }
            • 3. Re: Script Character Limitation
              MergeThis Level 4
              You just place all that JavaScript into a MyExternalJavaScriptFile.js and then insert something like this into your .htm file. The sample shows a relative link as if that file were two directory levels above the current file that's calling for it. Adjust the directory/filename according to your needs.

              Good luck,
              Leon