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;

}

})();

Tags: Acrobat

Similar Questions

  • change the fill color of button using action script.

    Hi guys... How to change the color of button using the action band. for example, I created a button, and the fill color for the button is green now. After I clicked on the button, I want the button to change the red color.

    If the text is a child of the button, it will be changed by this code.  to remedy this, you must use a background for your button and convert it to a movieclip (if you do this in the authoring environment).  Give it an instance name, as the bg.

    You can then apply the transform.colorTransform to yourButton.bg

  • Change the fill color based on the range of values

    Creating a form to inspect the parts. Work on the setting up of a text field to change the fill color based on the number or the data entered. For example: If is between 0-20 fill color is red, between 20-24 fill color is green, more filling 24 is still red, and if no data is entered in the fill color is white. The script below works for me but keeps the red field when data is deleted (empty) field. Not sure if im approaching this correctly so I should be looking at differently? I have different ranges for many fields and im trying to keep the script right to the front as possible. Thanks in advance for any help.

    If (event.value > '24')

    event.target.fillColor = color.red;

    Else if (event.value < '20')

    event.target.fillColor = color.red;

    else event.target.fillColor = color.green;

    You do not have... Change this line:

    Else if (event.value > '24')

    To do this:

    Else if (event.value > 24)

    And even with "20".

  • Symbols - how to change the fill color to a mouse event?

    I'm trying to convert HTML Flash animations.

    I have some problems with the symbols of the Edge. As a test, if I create a new symbol of circle I draw and call that the new 'Test' symbol, I then try to change the fill color in a scoring event.

    I tried this:

    Enter the code to be run when the mouse points to the object

    SYM. $("Test") .css ("background-color", "red");

    That, in fact, change the "background color", but NOT the fill color of my symbol. See the example below.hover.png

    So then how should I address the symbol 'Test' if I want to change the FILL color is an event like the hover?

    TIA!

    Use:

    sym.getSymbol("Test").$("Ellipse").css ("background-color", "red");

    where "Ellipse" is the element of circle inside the symbol

    HTH,

    Vivekuma

  • Change the fill color of button in Captivate 7?

    I'm sure that when I used 6 Captivate and I created a button, there is an option in the properties pane to allow me to change the fill color of the button. I use 7 Captivate now, and I don't see this option. Under the 'Général' tab, it allows me to change the type of button, caption, make transparent, or allows me to see the button widgets. They remove the possibility of simply changing the fill color of a button?

    Buton Fill.png

    Change the default Transparent button Style Style.

    Anthony

  • How to get the fill color of a shape or solid color fill layers?

    Hi all

    I'm trying to get the values of the fill color of a shape or solid color fill layers.

    I get the nature of the layer active i.e. SOLIDFILL, but there is no color as a property to get the color of the shape or solid color fill layers.

    Y there is it possible or a script to do this?

    Please help me on this.

    Thank you
    AI

    I didn't bother to check the type of the active layer, but if a solid color layer is selected it should help.

    // based on code by michael l hale;
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var layerDesc = executeActionGet(ref);
    var adjList = layerDesc.getList(stringIDToTypeID('adjustment'));
    var theColors = adjList.getObjectValue(0).getObjectValue(stringIDToTypeID('color'));
    var str = '';
    for(var i=0;i		   
  • change the fill color of the image

    I should produce small text boxes containing the reverse text (white letters on black boxes). How and where should I go to black color of picture fill?

    Select the image, and then to the swatches Panel, click the fill color icon in the upper left corner (the same icon is in the Toolbox and color Panel), then choose your fill color.

  • How to apply the transition to the fill color in the script? Call setValueAtTime? It does not work.

    Hello world!

    Can't stand not to code (setValueAtTime) following the transition from the fill color, but this feature is supported by After Effects CS5.5 UI. So please can you give a hint on how to implement the transition from the fill color in the script?

    ...

    Layer1 = app.project.item var (1).layers.addText ("Example Text");

    animator1 var is layer1. Text.Animators.addProperty ("ADBE Text Animator");

    var selector1 is animator1. Selectors.addProperty ("ADBE Text Selector");

    animator1 = animator1. Properties;

    animator1. AddProperty ("ADBE Text Fill Color").setValueAtTime(0,[0xff,0xe0,0x0,1]);

    animator1. FillColor.setValueAtTime(1,[0xFF,0x00,0xe0,1]);

    animator1. FillColor.setValueAtTime(2,[0x00,0xe0,0xFF,1]);

    animator1. FillColor.setValueAtTime(3,[0xFF,0xFF,0xFF,1]);

    animator1. AddProperty ("ADBE Text Rotation X") .setValue (ratationX);

    animator1. AddProperty ("ADBE Text Rotation Y") .setValue (rotationY);

    animator1. AddProperty ("ADBE Text Rotation") .setValue (rotation);

    animator1. AddProperty ("ADBE text scale 3D") .setValue ([100,300,100]);

    animator1. AddProperty ("ADBE Text Position 3D") .setValueAtTime (0, [-500, -300, -300]);

    animator1.position.setValueAtTime(5,[0,0,0]);

    selector1. Start.SetValue (0);

    selector1.end.SetValue (100);

    selector1.offset.setValueAtTime (0, -100);

    selector1.offset.setValueAtTime (3,100).

    selector1. Advanced.Shape.SetValue (2);

    selector1. Advanced.easeLow.SetValue (100);

    ...

    Thanks in advance!

    Your layers of color must be between 0 and 1, like this:

    animator1. FillColor.setValueAtTime (1, [1.0,.878, 1]);

    animator1. FillColor.setValueAtTime (2, [0,.878, 1, 1]);

    animator1. FillColor.setValueAtTime(3,[1,1,1,1]);

    Dan

  • CS3 AS2 - changing the fill color

    Hello!

    I don't know how to change the color of the movieclip but I can't find a way to change just the fill color of the movieclip and no hits... is this possible?

    I guess that there are several ways to do so.  I could change just the filling of an MC is to select only the filling and convert it to a symbol.  After giving your new symbol to an instance name, you can reference it in AS2 to change its color. I hope this helps.

  • dynamic changes of the fill color box

    I would like to know how to dynamically change the fill color of a checkbox control.  When I use the following code, I change the color of the object in its entirety (including the text).  I want to just change the color of the box.

    this.fillColor = "255,255,0;

    Any idea?

    Thank you
    Emily

    Try

    xfa.resolveNode("form1.page1.cb.ui.#checkButton.border.fill.color").value = "255,255,0;

    where the checkbox object is "form1.page1.cb".

    Steve

  • Remove the fill color of the field box on the deselection.

    When a user selects a check box, the field is colored yellow. Unfortunately, when the user disables the check box, the color remains.  I know that I need a statement to remove the color from the deselection, if/else, but can't quite get the right script. The checkbox named LEPID is my pig of India and he still has the nonfuctioning script that I worked with. Can someone tell me how to remove the fill color when the box is unchecked?  Thank you!

    Hi again,

    You had a few errors in the script:

    (1) in condition you should you use == instead =.

    (2) if (condition) but not if {condition}

    It's working script:

    If (this.rawValue == '1') {}

    this.fillColor

    = "244,254,114";

    }

    else {}

    this.fillColor

    = "255,25,128";

    }

    See also attach.

    BR,

    Paul Butenko

  • Opacity of the giving the same value as the fill color (reversal opacity/fill)

    I'm looking to add a script that takes the value of fill of nuances in my art folder and apply these values to the opacity of each sample.  I would also like to be able to adjust the fill value to be 100% when you are finished.  I have a javascript script that I thought would work, but it has no effect on any of the objects in the file.

    Example:

    Original art: object 1: fill 50%, opacity 100% / / object 2: fill 60%, opacity 100%

    Desired result: object 1: fill 100%, opacity 50% / / object 2: fill 100%, opacity 60%

    Any help would be appreciated.

    Sorry the question was silly and useless, so I deleted it...

    This is the absolutely most fundamental and most simple way to do this. It's not the ideal way because it relies on the hard numerical values. but with this, you should be able to design other variables or arrays to make it work with values that do not have to be hard-coded.

    var docRef = app.activeDocument;
    var paths = docRef.pathItems;
    
    for (i=0; i< paths.length; i++){
        if (paths[i].fillColor.tint == 50 && paths[i].opacity == 100){
            paths[i].fillColor.tint = 100;
            paths[i].opacity = 50;
    
            }
        else if (paths[i].fillColor.tint == 100 && paths[i].opacity == 50){
            paths[i].fillColor.tint = 50;
            paths[i].opacity = 100;
    
            }
        }
    
  • Script to change the fill color of the text box when the text is entered

    Hi all

    I'm working on a creation of a PDF form with a lot of text fields and I was wondering if it is possible to write a JavaScript script that will set the background color of the text box to white If the user enters any textand transparent otherwise. Any ideas?

    Thank you

    Zet

    Of course you can. You can do this during the Validate event, for example:

    Validate the script

    event.target.fillColor = event.value? Color.White: color.transparent;

  • Need help with the links and the fill color

    Hi all, I just recently discovered liveCycle and I am very impressed with it! I tried to get a calendar of working from home for awhile now and I did for the most part, but there are a few things more that I would like to add that I do not know how to do.

    I have experience HTML and Java, but very few XML or JavaScript experience. I have a feeling that what I try to do is relatively simple, but I just can't understand it! I spent hours on Google and the help files, and I feel that I got the end again, but not joy.

    I have attached my calendar (truncated to fit the size of max 5 MB attachments) so far. I would like it to do more than two things:

    1. have the background color of the table cells change from white to green when the checkbox is enabled.

    (Alternatively, I would really like to get rid of boxes to tick all the thogether and just the table cells background become green with a hotkey, such as "ctrl + D" to 'make'.) "But if this is not possible, then the color change with the box is fine).

    2. I want the button called "WORD DOC" in the upper right of the form to open a document in word on my local computer. I just push this button and a doc of work opens right in Word in another window.

    I was able to get. PDFs to open in the other two buttons here ('Big Java' and 'Beginning Java II') by adding the script

    app.openDoc ("Big Java.pdf");

    and

    app.openDoc ("Java beginning II.pdf");

    for each buttons respectively, but these PDF files must be in the same folder as the calendar to make it work. I tried just to edit this script by replacing the name of the PDF file by the name of a file to Word doc like this:

    app.openDoc ("test.docx");

    but the button does not work, there is simply nothing.

    So what I'm trying to do. I spent hours messing around with everything I could think of to make it work, but unfortunately I do not know the language well enough so he can work.

    I'd appreciate really any advice on this at all. I thank very you much for your review.

    Click on the second box to check and see the result.

    Is that what you want?

    Nith

  • Selection of objects from the fill color

    Hi guys

    Is possible to select a color to CMYK using JavaScriptobject?

    I want to group multiple objects with the same fill color.

    Thank you very much for your time...

    Please see the picture below...

    2.jpg

    Hello Puthoskey any good?

    Well, I wrote something like what I said, notes:

    This code works just to PathItems;

    Just CMYKColor;

    You must select a pathItem before running the script.

    Read selected item fillColor and a loop in all pageItems document, if the pageItem is a pathItem and having the same fillColor or strokeColor, it will be grouped with others;

    If you want to do it in other objects like textItems, you must follow the same logic;

    Try, test and enjoy, contact us for more rule.

    function selSameColor (){
    
        if(app.activeDocument.selection.length == 0){alert('Select a pathItem.'); return};
        if(app.activeDocument.selection.length > 1){alert('Select just one pathItem.'); return};
    
        var selFillColor = function(){
    
            var groupColor =  app.activeDocument.groupItems.add();
    
            if(app.activeDocument.selection[0].typename == 'PathItem'){
            var colorSel = new CMYKColor;
            colorSel.cyan = app.activeDocument.selection[0].fillColor.cyan;
            colorSel.magenta = app.activeDocument.selection[0].fillColor.magenta;
            colorSel.yellow = app.activeDocument.selection[0].fillColor.yellow;
            colorSel.black = app.activeDocument.selection[0].fillColor.black;
            }else{alert('This is not a pathitem.'); return};
    
            var itemsLength = app.activeDocument.pageItems.length;
            var items = app.activeDocument.pageItems;
    
            for (i = 0; i < itemsLength; i++){ 
    
                if(items[i].typename == 'PathItem'){ 
    
                    if(items[i].fillColor.cyan == colorSel.cyan && items[i].fillColor.magenta == colorSel.magenta && items[i].fillColor.yellow == colorSel.yellow && items[i].fillColor.black == colorSel.black){
                        items[i].moveToBeginning(groupColor);
                    }else if(items[i].strokeColor.cyan == colorSel.cyan && items[i].strokeColor.magenta == colorSel.magenta && items[i].strokeColor.yellow == colorSel.yellow && items[i].strokeColor.black == colorSel.black){
                        items[i].moveToBeginning(groupColor);
                    };
                };
    
            };
        if(groupColor.pageItems.length > 0){groupColor.selected = true};
        };
    
        selFillColor ();
    
    };
    
    selSameColor ();
    

    I hope this useful, see ya soon man.

    Best regards

    -Vinícius Baptista

Maybe you are looking for

  • Why my MB Air decreases the wifi signal

    My 2012 13 "core i5 MacBook Air running different operating systems will remove the wifi signal and it is getting worse. someone at - it a reason why?

  • Mail does not start after the installation of El Capitan

    I just installed El Capitan 10.11.3.  Well, everything seems to work except Mail which breaks down as he tried to upgrade.  It gives me this error message: "Mail must repair your mailbox information. Restart (the program and the computer) does not se

  • Satellite A305-S6916 - static noise on Skype

    I just got myself this laptop nice but the noise is killing me. I mean it's really annoying and when I try to connect with people on Skype, they hear not me, but there is static noise on the background that divert attention. Can someone help me? THnx

  • PCG-5K1L drivers

    Laptop: vaio PCG-5k1L - need drivers for the update hard drive + windows 7; can not find the model on the Web site larger hard drive update plan + add Windows 7 currently have vista

  • Cannot run Adobe Creative cloud of installation

    (On Windows 10)I downloaded creative cloud a few days ago, I ran the program, and he told me that I was out of disk space. I deleted some upwards, and now when I run CreativeCloudSet - Up.exe he'll ask me if I should give the program administrator pr