Custom JavaScript help

I have 5 combo with choice boxes of Y, N and NA. When enabled will score 3, when selected the partition is 0, when is selected the score indicates no score. I have a text box which then displays the final score in 5 drop-down list boxes, on a possible 15. I have a last text field that will show a pass or careless. A pass would be 15 nothing less that 15 is a failure. I have JavaScript custom indicating the following:

Invoke the var = new Array ("6 Combo Box 1", "6 Combo Box 2", "6 Combo Box 3", "6 Combo Box 4", "6-5 combo box");

var aDefault = new Array();

for (var i = 0; i < aFields.length; i ++) {}

If (this.getField(aFields[i]).value == this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

aDefault.push (aFields [i]);  This will create an array of fields not filled

}

}

var = v + this.getField ('Model Call Score') .value;

If (v > 14) event.value = "Pass";

else event.value = "Fail";

Check if aDefault contains at least one field

If (aDefault.length > 0) {}

Event.Target.Display = display.hidden;

hide my value if a field is always empty

}

else {}

Event.Target.Display = display.visible;

}

I understand that the last part of the code says to make the hidden value. I want a success or a failure is displayed only when all combo boxes are selected. I don't have knowledge of JavaScript. Could someone please help me fix my current or future code with another suggestion. A link to my form is attached. My question above refers to the lower part.

Change this line:

If (this.getField(aFields[i]).value == this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

To do this:

If (this.getField(aFields[i]).value = this.getField(aFields[i]).defaultValue) {//compares value in the default value field is empty

Tags: Acrobat

Similar Questions

  • Where can I add my custom javascript?


    I am trying to add some javascript to be called when the view of a topic. We have an excerpt at the foot of each topic page that calls the javascript code and also has the text of the copyright law. This call to the javascript function that inserts the snippet seems to appear at the end of the html of each topic very well.


    Now, I wanted to include the javascript function that is called by the extract of footer once not only within each topic, so I put it in the whutils.js. But unfortunately, the whutils.js file seems overwritten at any time that the html help project is compiled.


    Is it recommended to find out where to register custom javascript source that won't get beat over RoboHelp compiling?


    Thanks for any help.

    C

    Welcome to our community

    In general, I will create a. Text file JS that contains my functions and adds that, for luggage.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Is there a way to trigger an action advanced through custom JavaScript?

    I wish I had my 'normal' custom JavaScript trigger actions Captivate.

    This could be useful in a lot of ways, but what I would do right now must play an audio clip when certain conditions are met (a conditional, peak action is too clunky for my needs).

    Any way to do it? Thank you!

    You can trigger a fast action with JavaScript:

    cp.runJavascript (cp.model.data.objectName.oca);

    The script is advanced actions that are attached to objects, if it's a slide enter, you will need to find the id of the current slide.

  • PDF forms JavaScript help

    Hello

    I learned the hard way JavaScript forms may not work on tablets (through various OS). I have two scripts for calculating custom running in my form and I was wondering if there is another way to write, or a work around, where he will work on tablets (I'm no JavaScript expert!)?

    I have a calculation that counts the number of boxes in a list (check the 20-31) that are enabled:

    var total = 0;

    for (var i = 20; i < = 31; i ++) {}

    If (this.getField("Check_Box"+i).value! = 'Off') total ++;

    }

    Total = Event.Value;

    From there, I have another calculation that returns a value in another field, based on the number of boxes checked:

    var a = this.getField("Check_Box_Count").valueAsString;

    Event.Value = "";

    If (a == '1') event.value = "0.00";

    If (a == '2') event.value = "300.00;

    If (a == '3') event.value = "300.00;

    If (a == "4") event.value = "300.00;

    If (a == '5') event.value = "300.00;

    If (a == "6") event.value = "300.00;

    If (a == '7') event.value = "300.00;

    If (a == '8') event.value = "300.00;

    If (a == '9') event.value = "300.00;

    If (a == '10') event.value = "300.00;

    If (a == "11") event.value = "300.00;

    If (a == '12') event.value = "300.00;

    I don't know which one, or both, is the question. Is there a work-around, I could use?

    Thank you very much in advance for any help!

    ValueAsString property is not supported in Adobe Reader for iOS/Android. It is not clear to me if you could get away with using the property value instead, but of what you show this should work if you change the code to:

    If (a == 1) event.value = "0.00";

    etc.

  • JavaScript help please

    I want to be able to have a drop-down list box to automatically populate a field with a sentence or a number. I don't know javascript and need help.

    For example, in the "drop-down list box 1" - cats, dogs, Hamsters, fish

    If I chose to cats, the field 'Text1' must '25 000 '.

    If I chose the dog, the field 'Text1' must '10 000 '.

    I know that it is a simple custom calculation but still need help

    Thank you

    The easiest way is to set the value of the export of each element of list box the corresponding numerical value. The calculation simply sets the value of the field to the value of the drop-down list box. In JavaScript, this would be:

    Event.Value = getField("combo_box_1").value;

    If you do not want to set export values FRO the drop-down list box, the custom calculation script might look like:

    (function () {}

    Object to associate items drop-down list with numbers

    oval var = {}

    "Cats": "25 000",

    'Dogs': '10 000 ',.

    'The birds': '15 000 '.

    }

    Set this field to the associated to point number value, or empty if missing

    Event.Value = oval [getField("combo_box_1").value] | "";

    })();

  • If/then JavaScript help needed

    Hello

    I'm trying to write a script for a PDF in Adobe Acrobat form, but I don't have much experience with JavaScript and I need help!

    Basically, I have five fields as follows:

    A1 = a checkbox

    B1 = a field with a numeric value in it

    C1 = one field with a numeric value in it

    D1 = a field with a numeric value in it

    E1 = a field where calculation of the sum.

    I want to write a script that will enter into the sum of the values of B1 + C1 + D1 E1 if a1 is checked yes.

    If it is not checked yes, then he enters the sum of the values of B1 + C1 + D1 value by 2 (and rounded down) divided in E1.

    Can anyone help?

    Thank you!

    This should do it like the custom for E1 calculation script:

    // Custom calculate script
    (function () {
    
        // Get the field values, number fields as numbers
        var a1 = getField("A1").value;
        var b1 = +getField("B1").value;
        var c1 = +getField("C1").value;
        var d1 = +getField("D1").value;
    
        // Set this field (E1) value based on the state of the check box
        if (a1 === "Off") {
            event.value = b1 + c1 + d1;
        } else {
            event.value = b1 + c1 + Math.floor(d1 / 2);
        }
    
    })();
    
  • Focus / Unfocus spoils the fields when using custom fields - help

    Hello

    I hope someone can help me with a problem I see with a screen that contains a VerticalScreenManager that contains a number of custom HorizontalFieldManagers, which each contain a LabelField and an EditField.

    Note: I use a HorizontalFieldManager customer so that I can use sublayout to field possible as I need.

    The purpose of the screen is to allow the user to scroll through the fields and on the focus on the areas of editing.

    However, as the user rolls and fields in bulk and get focus, 'development emphasizing' is not 'cleaned' of previous field and so he is spoiling: several fields have the "update highlighting.

    I saw several other similar topics in the forum but nothing quite the same thing.

    Screen

    -Vertical area Manager (standard)

    -(Custom) HorizontalFieldManager - LabelField - EditField

    -(Custom) HorizontalFieldManager - LabelField - EditField

    -(Custom) HorizontalFieldManager - LabelField - EditField

    It seems that when the scrolling HorizontalFieldManager becomes and lose focus, but do not repaint itself? Is this possible?

    I use OS 5.0.

    Thank you very much

    David

    It seems that the problem was the VerticalFieldManager had not the color of the sae background as areas that are part of it and so when the focus and unfocus painted the background color VerticalFieldManager was painted, I don't know why this has been, and if it's a bug in the OS 5.0, but when I set the background color in the VerticalFieldManager I don't see the problem.

  • Ringtones using custom. Help, please.

    Hi all.  I am new to this forum and Palm.  A week ago I bought a Palm Pre Plus from Verizon.  I have version 1.4 update installed as well.

    My question is this: I've set up ringtones for specific calls.  I also put a song for "incoming calls" (i.e. calling strangers who are not personalized).  How to use custom ringtones I have for individuals?  I looked and looked for a week (since I bought the phone) for an answer to this question, nothing helps.

    Any help would be appreciated.  Thank you.

    Lauren

    Which plays for a contact that you have defined a specific song in your folder/Sounds/Ringtones ?

    How about a caller without a specific set of the song? Or an unknown number, which then plays?

    When you set individual ringtones and global, are you able to preview them by clicking on the button play to the right of the file name? After you have previewed, you tap on the name of the ringtone to change setting?

    There is no further action to take to assign a ringtone outside either overall or individually or both. The individual parameters replace the world for contacts where it is set. If it is not set, the global setting will remain.

    You can also consult the article Palm wrote for more in-depth coverage here.

    Life moves fast. Don't miss a thing.

    TreoAide

  • JavaScript help: get the current line inside tabular

    Hello world

    I hit a roadblock for a simple JS code: to get a current line for my tabular form. My environment is: Apex 4.2.6 on Oracle 11.2 with 3 Bootstrap for styling.

    The query in tabular form is as simple as this:

    Select

    "REF #"

    «INV #»

    "MANUFACTURER."

    "DISCOUNT."

    'PRICE ',.

    "UPC",

    "DESCRIPTION."

    quantity,

    "LINE NO.",.

    "" step by step

    of Order_items

    Now the emphasis here is "stepper", it is defined as "text save any State", in the expression of the HTML, I added this:

    < div class = "btn-group" >

    < button type = "button" class = "btn, btn - lg" onclick = "plusClicked ()" > + < / button >

    < button type = "button" class = "btn, btn - lg" onclick = "minusClicked (); ">-< / button >

    < / div > <!-/-> button

    The screen is as follows:

    Screen Shot 2015-02-06 at 9.44.49 AM.png

    In the header of the Page Javascript section:

    function plusClicked() {}

    var line, qty;

    Row = $(this). Closest ("TR");

    I tried row = $(this) .parent () .closest ("tr");

    same undefined result

    Qty = Row.Find ('input [Name = F09]'). Val();  F09 is the entry for the qty column name

    Alert ('most clicked qty =' + Qty);

    }

    The result is always: 'most clicked qty = undefined ".  Inspect the code says this:

    Screen Shot 2015-02-06 at 9.57.49 AM.png

    Any help and suggestions are greatly appreciated.

    The few I tested it seems solid to me.  I think you have to pass 'this' to plusClicked and minusClicked.

    onclick = "plusClicked (this)" "

    Then, the function can do:

    function plusClicked (btn) {}

    var line, qty;

    Row = $(BTN). Closest ("TR");

    Qty = Row.Find ('input [Name = F09]'). Val();  F09 is the entry for the qty column name

    Alert ('most clicked qty =' + Qty);

    }

    The other approach, I like it for it's with a DA.  I would like to add a class to the buttons instead of the onclick.

    DA would be during the click on jQuery selector .btnPlus

    and the JS to run would be:

    var $row = $(this.triggeringElement) .closest ("tr");

    var qty = $row.find('input[name=f09]').val ();

    Alert ('most clicked qty =' + Qty);

    I hope this helps.

    Thank you

    -Jorge

  • JavaScript help

    Hello

    I need help with javascript.   I have a dynamic action similar to below, but instead of testing a string of 1 byte, I want to test a substring.   So, if C1 = "111111', and I want to test check the first character (IE."  '1'), how I would clarify that?

    Thank you.

    Paul

    $("td[headers='C1']").each(function(){
       switch($(this).text())
       {
            case "1":
               $(this).parent().children("td[headers='FC_QTY_MONTH01']").css({"background-color":"#FFFF99"});
               break;
            default:
               break;
        }
        $(this).css({"visibility":"hidden"});
        $("th[id='C1']").css({"visibility":"hidden"});
    });
    

    Hello

    Try using the substr JavaScript method.

    http://www.w3schools.com/jsref/jsref_substr.asp

    Try if it works

    $("td[headers='C1']").each(function(){
       switch($(this).text().substr(1,1))
       {
            case "1":
               $(this).parent().children("td[headers='FC_QTY_MONTH01']").css({"background-color":"#FFFF99"});
               break;
            default:
               break;
        }
        $(this).css({"visibility":"hidden"});
        $("th[id='C1']").css({"visibility":"hidden"});
    });
    

    Kind regards

    Jari

  • Opacity of custom brush HELP

    Help, please.  Whenever I do a custom brush, it records at 50% opacity.  I must have a setting like this, but I'm not...

    It looks good on my screen when I do the tip of the brush, and then when I save and try to use it, it comes out with a 50% opacity, but the cursor is at 100%

    To get an opaque brush to 100%! You must be black. It uses the lightness of the defined area to create different levels of opacity of your brush.

  • Work with custom JavaScript properties

    Hello

    On a form, in JavaScript, I'm trying to reference custom properties (created manually by accessing the file > properties > info > custom properties).  I need set the properties, just bring.  I know how to get the properties by default (for example, title, Description, Version, etc.), and I can get/set variables I created (file > form properties > Variables), but custom properties have left speechless me.

    The closest I found is the FormData.extras object, which is documented as being "an envelope around one or more sets of custom properties. The content of this element can be used by custom applications", but it does not contain anything.

    I feel that I have forget an easy answer, but I'm stumped.  Is it still possible?

    Event.Target.info.

  • JavaScript: Help with IF statement

    I'm not familiar with Java and I fight with this IF statement and I can't make it work.  I'm sure it's something pretty basic.  Can anyone help?  I tried everything, seeminly.  In this example below I'm checking if the data that the user has entered in the field of the AAA FAVOR and if it is then put in place a message and if not then set up another message.  My top node in my hierarchy is data, and then I have a MainSubform and a Contact02Subform.  I have this code attached to a button and notthing happens when I click the button.  If I delete the statement and have just the box of message by itself, then it will display the message box.  So I know that's my statement and I'm sure it's simple.  Help please?

    If

    (xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR").rawValue == 'AAA')

    {

    xfa.host.messageBox ("my IF");

    else ;

    xfa.host.messageBox ("my ELSE");

    endif;

    Try this.

    If (rawValue. xfa.resolveNode("xfa.form.data.MainSubform.Contact02Subform.FAVOR") is 'AAA')

    {

    xfa.host.messageBox ("my IF");

    }

    on the other

    {

    xfa.host.messageBox ("my ELSE");

    }

    endif is used in FormCalc are generally not in JavaScript.

    Thank you

    Sidonie.

  • Sum of JavaScript help

    Hi people,

    I have a LiveCycle application form that calculates a total purchase amount. If this total is equal to or greater than $1 000,00 subform 'comparativeBids' must be made visible. The calculation works very well in FormCalc but not in JavaScript. Can someone help me understand how to calculate JavaScript to function? I'm not familiar with FormCalc enough to write conditional statements using this language but I am ready for, it is somebody can provide the script.

    Anyway, here's my JavaScript for grandTotal (calculate event):

    PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal::calculate - (JavaScript, client)

    this.rawValue = subtotalRow.subtotal + taxRow.tax + shippingRow.shipping;

    comparativeBids.presence = 'hidden ';

    var order = xfa.resolveNode("PRForm.generalInfo.totalGroup.totalTable.grandTotalRow.grandTotal").rawV Alou;

    If (order > = 1000) {}

    comparativeBids.presence = "visible";

    }

    Note: I also tried the calculation as this.rawValue = subtotalRow.subtotal.rawValue + taxRow.tax.rawValue + shippingRow.shipping.rawValue; - again without success with the JavaScript version.

    Thanks in advance for the help!

    Well in formcalc if statement would be:

    If ($ > = 1000) then

    comparativeBids.presence = "visible".

    on the other
    comparativeBids.presence = "hidden".

    endif

  • Custom JavaScript button close

    I have problems with a javascript custom button during export both swf and html 5 with the AICC LMS settings.

    When just using html5 out the button works fine, here is the content of the script window:

    Window.Open (","_self",");

    Window.Close ();

    The first line was added because Firefox keeps closing window unless it was opened with the window.open() method.

    However, even with the patch, output swf also selected in the publication settings window closes at all.

    I was wondering if maybe because the index.html file in the output of the AICC, is choosing the html5 or the swf through the line - newFrame.src = "index_AICC.html"; "" That the fact that it opens in a frame somehow the javascript is not able to close the top of the window? I played with all the settings in Captivate Javascript the extent of change of the target to top window, parent, Gites, etc without success.

    Any suggestions on the contribution of a push to close the custom window that works in html5 and flash, while using AICC?

    You might be interested in the link below:

    Click here to see

    See you soon... Rick

Maybe you are looking for