Skip to Content

Adobe Form [print based] - Javascript to addup row

Hi,

I need to get the row total and display it in the form for which i need some help on java script. pls can anyone throw some light or some help on it?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 02, 2014 at 07:53 PM

    Hi Prabhu,

    Do you need table like below ?

    C1C2Total235347448

    If yes, please use below script, if you are planning to use javascript

    var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
    var total = 0;
    for (var i=0; i <= fields.length-1; i++)

    {
    if (fields.item(i).name == "C1")

    {
    total = total + fields.item(i).rawValue;
    }

    if (fields.item(i).name == "C2")

    {
    total = total + fields.item(i).rawValue;
    }

    if (fields.item(i).name == "Total")

    {
    fields.item(i).rawValue = total;

    total = 0;
    }

    }

    else,

    please create table type in interface and in code initialization, calculate the total column and use it accordingly in form.

    Thanks,

    Rakesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.