1 person found this helpful
There are a lot of things wrong with the code, and the document you linked to hasn't been published/shared properly so I can't examine it to help understand what it is you're trying to do. Is this a form you created in Acrobat or LiveCycle Designer?
I'm sorry George, I thought that one was accessible. I am such a newbie with this - only second or third day here. LOTS of things wrong ..OMG . . then I am definitely in need of help -- or a psychologist LOL. I will try to link to another document. I just save it as a pdf right? No special save technique?
OK - maybe this will work.
I found this example which is about as close as I can come to the kind of syntax I may need. I am going to assume I don't need html tags but just the <script> before and at the end? for starters. Correct? Next I see there is the use of eval function and Calc (can't find a syntax for this) Do I have to convert the fields/objects to numbers? So I guess I can't just multiply one field by another? Ihave to call the number using Number() function?
//Validate here to see if the fields have a value
//if yes, Validate here to see if the fields have a numeric value
//if yes do the stuff below
//repeat step for each box (each box must have a numeric value)
<input type=text name="field4output" size="12" readonly><br>
Message was edited by: AffordableParalegal
You really can't just take an HTML script, delete a couple of things, and get a PDF script. There is nothing in this that could be salvaged. You need to move to the point where you understand each and every line in the script, what it does and why it is there (even if you couldn't write that line from scratch).
But let's look at your questions, they are interesting.
Next I see there is the use of eval function
and Calc (can't find a syntax for this)
Now, Calc is a function used in this script. Notice at the top
... some lines which won't work in Acrobat...
That defines a function called Calc, which can now be used to do work. You would write just Calc() to do that. (This example calls Calc() but not in a way valid in Acrobat). A function is just like writing out the stuff in the function every time it is used ("called") but is there to save time and avoid the mistakes which come from retyping. It's a really useful thing for beginners to learn early.
Here's an example of a function that calculates the average of three numbers
var sum = x+y+z ;
var average = sum / 3 ;
Suppose you wanted the average of fields called f1, f2, and zoom in Acrobat. You could write
var f1=this.getField("f1") ;
var f2=this.getField("f2") ;
var zoom=this.getField("zoom") ;
var theaverage = AverageOf3(f1,f2,zoom) ;