Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 77806

Re: doc is not defined

$
0
0

Hello

 

I have gotten somewhere with the code.  Not very far, however.

 

 

I first tested a form with one text field and a button that calls the subSrchValPM() function of a folder level javascript file.

I pasted the following string of text into the form field"

7.4%,0.1%,0.4%,9.7%,53.1%,0.5%,15.5%,4.8%,1.6%,5.7%,1.0%

and clicked the submit button that calls the subSrchValPM() function.

 

Here is the subSrchValPM() function:

 

function subSrchValPM() {

    var searchThis = "";

    searchThis = this.getField(1).valueAsString;

    console.println(searchThis);

}

 

It prints out the string of numbers in the debugging console.

 

However......

 

When I take out the "console.println(searchThis); " line

and replace it with this: "searchArray(this,searchThis,0,1);"

 

I get the following error:

 

TypeError: Invalid argument type.

Doc.getPageNumWords:187:Field SubmitButton:Mouse Up

===> Parameter nPage.

 

 

However, when I run the following code in the debugging console:

 

 

var searchThis = "7.4%,0.1%,0.4%,9.7%,53.1%,0.5%,15.5%,4.8%,1.6%,5.7%,1.0%";

searchArray(this,searchThis,0,1);

 

 

I don't have a problem and get these results in the debugging console:

 

true,true,true,true,true,true,true,true,true,true,true

 

It prints out "true" whenever it takes a number from the string that was submitted and finds it in the two page document it is searching.

 

So why does the searchArray function work when I test it in the console, but not when I test it in the folder level JavaScript file?

 

What do I need to change to make it work in the folder level JavaScript file?

 

Thanks

 

Linda


Viewing all articles
Browse latest Browse all 77806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>