script for reading calculated field changes color according to requirement

I need help to create a script that would do a single reading calculated field to change color if a condition is met.  If the script placed in the calculated event?

The fields are:

CourseNum (automatic sum calculates 11 different numeric fields)

A1p (digital calculated read only field)

AP (digital calculated field read-only)

HIGHA (the sum of the A1P and AP) - this is also a calculated read-only field

Therefore the condition:

If CourseNum > 20 and HIGHA > = 50%

then change the background color of the yellow HIGHA

otherwise, it should be white

This is your statement. The "or" is the last used operation. So, you're saying, ' if the year 4 and (B1P + BP) > ".45" OR so (B1P + BP)<".30" and="" coursenum="">= "20", then change the background.»

Try:

If (form1. #subform [0]...) YearLevel == 4 & ((B1P+BP) > ".45" or (B1P + BP)<".30") &="" coursenum="">= '20')

Tags: Adobe LiveCycle

Similar Questions

  • How to make a stationary State (or equivalent) for the form to change color and reveal some hidden above text...? is there a widget I could use?

    How to make a stationary State (or equivalent) for the form to change color and reveal some hidden above text...? is there a widget I could use?

    There are many solutions. A more simple: put the text and the items colored in the back and put the 'shape' on it. Configuration of the 'shape' become transparent in a stationary state.

  • Auto form field change color/data from pronounce on another page

    Adobe form help.jpg

    Hello!

    I recently got help on the forums and was able to write javascript to change the form fill and border based on an entry of individuals (thanks!).  I am now to experience the problems that I continue to work on this document.  I drew a picture that illustrates 3 different results, its located above.  To explain what I need, here is how the form is supposed to work:

    1. a user enters the State of equipment on page 2, I make sure that only AAA, BBB, CCC or s/o became acceptable.  Each value changes the field of form as shown above and n/d is no change on the ground at all.

    2. based on the user to page 2 input, I'm trying to get a form field only read to a "general status" page to change the color and change its value based on these entries.

    The three columns above show the 3 possible outcomes of the general State of page 1, that is to say:

    1: date of AAA [BACKSPACE] page 2 Date1 field. (all user entries are AAA (n/a which is not taken into account))

    2: date of BBB [BACKSPACE] page 2 Date1 field. (user input contained one or more of the values BBB or CCC)

    3: date of CCC [BACKSPACE] page 2 Date1 field. (all user input were CCC)

    I do this train to work and don't have adobe Adobe Acrobat XI worm: 11.0.13 at home.  Thanks for the help and if my description or photo is confusing, let me know and I can try to explain it differently.  Each column is a document, the document possible self doesn't have a 3 columns.

    J

    Let's see if I understand:

    1. the user enters 'AAA', and the color of the background/outline field turns green.

    2. the user enters "BBB", and the color of the background/outline field turn yellow.

    3. the user enters "CCC", and the color of the background/outline field turns red.

    4. the user enters "S/o", and the default color (it looks like teal) will be used

    4. If all the entries on page 2 are of the same color or the value "N/a", this color will be used for the field page 1

    5. If all the entries on page 2 are not the same color or the 'N/a', 'yellow' color value will be used for the field page 1

    Describes the behavior of the form?

    I would use a document level function to manage both the validation of the seizure and the choice of colors. The first part of the function (validation) is quite simple. The second part (setting the current color of field) is something that you already know how to do it. The third part, determine the color of a field of the general State is a little more complicated. I would like to look at all the fields that are not current on the ground - loop - (because you can just make a call to Doc.getField ()), then take the current information in the field of the event object in the validation script and determine what should be the status of the output (and then set the color accordingly).

    Something like this should work:

    function ValidateStatus() {
        // is the data entered either "AAA", "BBB", "CCC", or "N/A"?
        if (event.value == "AAA") {
            event.target.fillColor = color.green;
            event.target.strokeColor = color.green;
        } else if (event.value == "BBB") {
            event.target.fillColor = color.yellow;
            event.target.strokeColor = color.yellow;
        } else if (event.value == "CCC") {
            event.target.fillColor = color.red;
            event.target.strokeColor = color.red;
        } else if (event.value == "N/A" || event.value == "") {
            event.target.fillColor = color.cyan;
            event.target.strokeColor = color.cyan;
        } else {
            event.rc = false;
            app.alert("Only the values 'AAA', 'BBB', 'CCC', or 'N/A' are allowed");
            return;
        }
    
        // set the field on page 1
        var fields = ["Status1", "Status2", "Status3", "Status4"];
        var theStatus = "N/A";
        for (var i in fields) {
            var v;
            if (fields[i] != event.target.name) {
                v = this.getField(fields[i]).value;
            }
            else {
                v = event.value;
            }
            if (v == "N/A" || v == "") {
                continue;
            }
            else if (theStatus == "N/A") {
                theStatus = v;
            }
            else if (theStatus != v) {
                theStatus = "BBB";
            }
        }
        var msg = theStatus + "\n" + this.getField("Date1").value;
        var theColor;
        if (theStatus == "CCC") {
            theColor = color.red
        } else if (theStatus == "BBB") {
            theColor = color.yellow;
        } else if (theStatus == "AAA") {
            theColor = color.green;
        } else {
            theColor = color.cyan;
        }
        var f = this.getField("OverallStatus");
        f.value = msg;
        f.fillColor = f.strokeColor = theColor;
    }
    

    You then call it in four areas as a custom validation script:

    ValidateStatus(event);
    
  • How to register properly for CMYK/RGB without changing color?

    I have 350 - something icons that are in different color combinations. I tried earlier correct colors, like the colors of profile where I work have changed over the years (Ref: change the colors of the icons in different files). Lately, I noticed that the colors have changed when I save in Illustrator. If a color orange which is supposted to be CMYK: 0, 43, 90, 0 ends up being 0, 43, 89, 0 instead of this (or any other variant).

    Now I'm really hoping to get rid of the problem. I'm thinking of changing the orange color manually, and hopefully change the color icon in the manner described in the linked post to the. I also think about saving icons in another format and color mode. I did it earlier, but I lived to change color.

    My icons are now in .eps with CMYK document mode files.

    I'm looking through:

    CMYK:

    -eps

    -tiff

    RGB:

    -jpg

    -rgb

    -svg

    Does anyone have advice good savings on these format, without getting colorshifting?

    Check your color management settings.

    There should be no conversion on opening the file.

    When converting to RGB but you have to wait the color "changing." Numbers can not just stay the same.

  • Dynamically change color according to the value of the field field

    I hope someone can help with my problem, I have not dealt with Java Script before please bare with me as I try to explain.  I tried searching everywhere for the answer but am getting lost a bit in some answers just so I was wondering if anyone on the forum can help.

    I am trying to create a reliable PDF form for a risk assessment. The user in the columns of the severity and probability input values and the value is generated automatically in the column risk classification. So I managed to get the number of risk rating to calculate automatically using the option calculate and select the value is the product of "Severity1", Likelihood1  It's great, so now I want to the field of evaluation may change the background color based on the value as follows:

    1-5 = Green

    6-10 = orange

    11-25 = Red

    I don't have any idea if this can be done via the Java Script or if it is not possible, I'm sure it will, but I need someone much smarter than me to guide me on how to do it. I guess it's the same concept as the conditional formatting in Excel.

    This is something like what I'm trying to achieve.

    Any help would be greatly appreciated

    Thank you

    Matt

    Gravity
    Likelihood
    Level of risk
    122
    236
    3412

    You will need to use a custom calculation script, something like:

    Custom calculation script

    (function () {}

    Get the field values as numbers

    var v1 = + getField("Severity1").value;

    var v2 = + getField("Likelihood1").value;

    Calculate the product

    var prod = v1 * v2;

    Set the value of this field;

    Event.Value = prod;

    Default background color

    var bg = color.white;

    Set the color orange

    Color.Orange = ['RGB', 1,.33, 0];

    Determine the background color on the product

    If (prod > = 1 & prod)<=5)>

    BG = color.green;

    } ElseIf (prod 5 > & prod)<= 10)="">

    BG = color.orange;

    } ElseIf (prod > 10) {}

    BG = color.red;

    }

    Set the background color of the field

    event.target.fillColor = bg;

    })();

  • How to create a script for the calculation of the VO2max using text on a pdf form field values.

    I'm trying to create a script that calculates the VO2max based on user input in several text fields.

    My form is set up so that the user can enter values in the 4 fields of text:

    1 weight = weight in kilograms

    2. age = age in years

    3 time = time to walk 1 mile in decimal

    4. the heart rate (HR) = heart rate recovery immediately after you have finished walking 1 mile

    The VO2max equation that I use is:

    VO2max = 132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    After the user enters values in 4 text fields, I want the text of VO2max field automatically calculate the above equation and display the result to the user so that the user doesn't have to get all those numbers into a calculator.

    Any suggestions on how to write the script?

    Assuming that your domain names are what you entered in the formula, you can use the simplified field notation:

    132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    If you want the value to display only after al the data fields are complete you need to use a JavaScript calculation:

    function GetField (cName) {}
    oField var = this.getField (cName);
    if(oField == null) app.alert ("field of error for access to the" cName + "\nPlease verify the name of the field.", 1, 0 ");
    return oField;
    }

    var weight = GetField ("Weight");
    var Age is GetField ("Age");.
    var time = GetField ("Time");
    var h = GetField ("HR");

    Event.Value = "";
    If (Weight.value! = 0 & Age.value! = 0 & Time.value! = 0 & HR.value! = 0) {}
    Event.Value = 132.853 - (0.1692 * Weight.value)-(0.3877 * Age.value) + (6,315) - (3.2649 * Time.value)-(0.1565 * HR.value);
    }

  • JavaScript to perform the Action on the ground form - change the fill color according to requirement

    Hello world

    I apologize if this question has been asked already - but I was looking for the last hours of the couple and not finding what I need. I have a PDF form (created from an excel file) and need to change the fill color of a field drop-down list box to, based on the selection made by the user of this form field.

    Details - I have several questions on the application form. I have install a form field list box for each question so that the user can select the following options:

    Yes

    NO.

    Not sure

    I see in the Properties menu of the form field that I can perform an action when their "clicks of the mouse to the top" as the trigger (option run JavaScript); but I do not know what script to enter to do. This is where I need help

    So I need the script when the user selects one of the listed options, the fill color will change depending on the selected answer:

    'YES' changes fill with green color

    'NONE' red fill color change

    Yellow fill color of changes 'UNCERTAIN '.

    Please let me know if you need more details or a better explanation of what I need. Thank you for anyone who can help!

    PS - I'm a complete amateur in any type of JavaScript or codes, so I may need some explanation or if this is not possible.

    Do not use the mouse event to the top, but rather, you can use the custom following validation script:

    Custom script to validate combobox

    (function () {}

    Switch (event.value) {}

    case study "Yes":

    event.target.fillColor = color.green;

    break;

    case "No":

    event.target.fillColor = color.red;

    break;

    case 'uncertain ':

    event.target.fillColor = color.yellow;

    break;

    by default:

    event.target.fillColor = color.white;

    break;

    }

    })();

  • Script for updating a field for the current year

    Is it possible to have an update of field at the end of the current year? Example 20-(dashes to change it for any year). I think that it is not possible, but if anyone knows how this is possible I'd really appreciate help. Thank you

    Sorry, I guess I need to change throughout the year, not only at the end.  Thank you

    I tried a few scripts that I found here, such as; year (dateAdd ("yyyy", 1, now()))) with no luck. I confess that I don't know about scripts and can be a bad thing. The script goes on the Action tab as a javascript or somewhere else (validation?) Any advice or assistance would be appreciated. I use Acrobt Pro version 9.

    Going by your post you wanted the year is displayed in a text field, I gave the code to go into the script will count for this field. If you want to use it somewhere else (e.g. a mouseup), then use the variable 'year' in this script. In a calculation script, any value you assign to "event.value" is what will show on the field during the calculation.

  • The Script for the calculation of the Vs Web planning security

    Hi all

    I loaded a few accounts one read access to planning and these accounts are calculated by the calculation script. So if the user starts the calculation script will run even if I read access assigned to members in web planning? Read in planning web access has no control over the data which are calculated via the calculation script?

    Please advise!

    Hello

    Why don't you just use of rules of business instead of calc scripts, you have added security and can limit the calculations for what's on forms using variables.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • I need a custom script for the calculation in a PDF form.

    I am working on a form of commissions airport rental cars with exclusions.  Could someone please a custom for the following script?

    R + C = less the sum of (Ea, Eb, Ec)

    Thank you!

    Under the Simple field of tab notation option calculate enter:

    R + C - (Ea + Eb + Ec)

  • Dynamic text field changes color but the bullets are not html text.

    I am tarea to use a dynamic text field to shoot in the html text that contains a bulleted list. Easy enough, that works. But don't take the balls on the color assigned to the field. I tried to put in the html text and also using NewTextFormat and no work. Someone can help me. This should be a simple solution, but I'm not... I want my text and bullets to both be white.

    Simple code below. Using html text inside the document flash and presence of a PivotTable field on the screen named txt. Code should turn text and green balls, but it does not work, only the text goes green

    This.txt.html = true;

    var my_fmt:TextFormat = new TextFormat();
    my_fmt. Color = 0x00FF00; hexadecimal value corresponding to green

    this.txt.htmlText = "< P > This is the first paragraph < /P > < BR > < UL > < LI > Bullet 1 < /LI > < LI > < BR > Bullet 2 < /LI > < LI > < BR > Bullet 3 < /LI > < LI > < BR > Bullet 4 < /LI > < LI > < BR > Bullet 5 < /LI > < /UL >";
    this.txt.setTextFormat (my_fmt);

    Thanks for any help you can give me.

    works for me:

    create a new fla and add a textfield, the name of your instance and copy/paste the code that I have proposed.  any problem?

  • Help with a script for the date field

    Is this possible when the display of a date field is not also: date {EEEE, MMMM D, YYYY}

    then

    Message: "Please select a date from the calendar to the date.

    and focus on the date field

    Thank you

    I thought the event output, if you change the this.rawValue to xfa.event.change, you can try to use the calculate... event, which would mean that they get the message earlier.

    Anyway they will always be able to cut-and - paste a date if it is in the correct format.

    Bruce

  • How to disable the warning of validation on the calculation (read-only) field in the table

    Is it possible to add a line in a calculation script (JavaScript) that prevents a dialog box of a calculation field validation?

    Scenario:

    • Working with fields in a table inserted.
    • In each line, I have a couple of fields that the user has entered. These fields have a Validation model has allowed that the user must enter the data correctly.
    • There is a calculated field based on the data entered by the users. It is this field that throws a warning dialog box "the value entered for Total_Row1 is not valid. "To ignore the validations for Total_Row1, click on ignore.

    Even if I turn off the Model Validation on fields used for the calculation of the warning dialog box always appears. So, it seems to be isolated in the field of computing.

    The calculation area displays the time and I got it originally set as a Date/time field, but also tried to use a text field (as the calculation should appear as 0:45 for 45 minutes in this area).

    I have a suspicion that the warning appears only because I used an array for formatting fields, as I used similar validation profiles and other calculation fields and see not the message when the fields do not appear inside the table.

    I think of easier workaround would be to disable validation for this particular calculation field, but I have no idea how the script that. Any help appreciated lot.

    CARI

    I discovered the problem.  In a word: it was a mistake by naming the fields.

    • I have fields named with line numbers in the field name (for example FieldName_Row1).
    • and fields calls with FieldName_Row1.formattedVallue must have triggered some confusion.

    As soon as I removed the word 'Row' of file names, the question of the warning dialog validation mystery Adobe Acrobat for the calculation field have disappeared.

    Ago about 3-4 hours of my life that I won't be back... ha - ha but if someone else has the problem, I thought I better share my discoveries

  • form field background changes color without reason

    Puzzled puzzled and bewildered with this one

    I have a page normal formail developed that works very well in the function layout and style with the fields being styled with css.

    HOWEVER

    When the field is preceded by the words name or Email the field changes color to a muddy yellow color instead of the background color applied

    SEE: http://www.royalforesterinn.co.uk/table.html

    Note:
    If I have above with bname say he retains the style

    No idea why guys?
    and how do I solve this problem?




    Google toolbar?

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.dreamweavermx-templates.com - template Triage!
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================

    "Javo_1" wrote in message
    News:efis21$9LQ$1@forums. Macromedia.com...
    > Puzzled baffled and bewildered with this one
    >
    > I have a page of normal formail developed that works very well in the layout fucntion
    > and
    > style with the fields being styled with css.
    >
    > HOWEVER
    >
    > when the field is preceded by a reference name or Email field changes
    > color of a muddy yellow color instead of the background color applied
    >
    > SEE: http://www.royalforesterinn.co.uk/table.html
    >
    > Note:
    > if I have above with bname say he retains the style
    >
    > Any ideas why guys?
    > and how to fix this?
    >
    >
    >
    >
    >
    >

  • Display 'ERROR' in calculated field so dependent on the invalid fields

    With the help of oracle forms 10 g 2.

    I have a field on a form that calculates its values from the other 3 fields/values provided to it. Is currently is a numeric field. The form acts as a case of mistaken for why a presentation could not operate, and so the fields could have given "bad" in them. If one of the three fields that are used for the calculated field is invalid, is there a way to display 'ERROR' in the calculated field or should I simply display an error message instead?

    IE:
    If a is 1, b 2 and c 3 calculated field would display "6".
    If a is 1, b 2 and c f the calculated field would display "ERROR".

    If you make a char data type, the calculated field, you can put whatever you want in it, numbers or the Word error.

    You can even create a calculation function that returns the text - either digital or alpha.

Maybe you are looking for