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

Calculation based on MessageBox Input

koenigma
Registered: Jan 23 2008
Posts: 45
Answered

I have a form that I have made wth LiveCycle Disinger which has fileds to enter the mileage costs and I would like that it calculates the value based upon the miles which are entered in a MessageBox.

Below is the script which opens รก MessageBox

var sResponse = xfa.host.response("How many miles have you driven?", "Enter Your Mileage", "", false);
xfa.host.messageBox(sResponse, "Your Response", 3, 2);

The problem I have is how to get the user input to calculate and entered into the respective field. (Auto_M_Col_1)

Any help would be appricated

Kind Regards
Martin

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You can use use following "enter" JavaScript to compute amount for the IRS business milage rate:
// ask for miles drivenvar sResponse = xfa.host.response("How many miles have you driven?", "Enter Your Mileage", "", false);xfa.host.messageBox(sResponse, "Your Response", 3, 2); // a confirmation$.rawValue = sResponse * 0.585; // compute dollar amount at current IRS milage rates

You may want to add some addiional code to verify only numberic values are being entered.

George Kaiser

koenigma
Registered: Jan 23 2008
Posts: 45
Thank you for yoour help, that is what i was looking for.
Kind Regrads
Martin