These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

LiveCycle form with Javascript not working

goslinc
Registered: Sep 25 2007
Posts: 114

I cannot tell what is wrong in my script that my fee is not computing. It will compute if I remove my IF statements, but I really need to get this IF working...HELP

var dataroot.Receipt.Fee = 0 // clear the fee value
// if question 1 is yes then compute fee
if (dataroot.P1.SReport.BorrowStatus == 1) then
dataroot.Receipt.Fee = dataroot.P1.SReport.AIssue.rawValue * 0.0002
// test for over maximum fee
if (dataroot.Receipt.Fee > 1000) then
dataroot.Receipt.Fee = 1000 // maximum value
endif // maximum value
// test for below minimum fee
if (dataroot.Receipt.Fee < 100) then
dataroot.Receipt.Fee = 100 // minimum value
endif // minimum value
endif // Qstn1
$.rawValue = dataroot.Receipt.Fee; //set the field value

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi goslinc,

Have a look at this tutorial from the Learning Center on writing conditional scripts-
http://www.acrobatusers.com/tutorials/conditional-execution

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
goslinc
Registered: Sep 25 2007
Posts: 114
Believe it or not I have looked at that tutorial.