Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script Character Limitation

New Here ,
May 24, 2007 May 24, 2007
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
229
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 24, 2007 May 24, 2007
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2007 Jun 11, 2007
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;
}
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 11, 2007 Jun 11, 2007
LATEST
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


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp