Is it possible to assign a variable only if the field is filled?

I have a formula that calculates multiple variables on the base. It's driving me crazy. It will work great for a few months and then it will stop working correctly and the debugger will come up with a lot of mistakes. The quantities of leaflets of form for several different ships and needs a lot of variable - I don't know if this has anything to do with it.

I get the error message:

TypeError: this.getField (...). value.toUpperCase is not a function

34:acroform:DPoundsA:CalculateException online function top_level, script AcroForm:DPoundsA 34: calculate

Here is a sample of the coding for one of the 13 lines to calculate the remaining quantity in the vessels, is anyway to simplify this:

Use the entry in the field trailer Drop weight to determine how much to subtract the weight fall entry to calculate talon books

heel of var = this.getField("DWieght").value;

If (heel > 0) {}

If (this.getField("Trailer").value == '86001') {}
Event.Value = heel-22040;
}
If (this.getField("Trailer").value == '86002') {}
Heel-22700 = Event.Value;
}
If (this.getField("Trailer").value == '4742') {}
Heel-22480 = Event.Value;
}
If (this.getField("Trailer").value == '86003') {}
Heel-22480 = Event.Value;
}
If (this.getField("Trailer").value == '86004') {}
Event.Value = heel-22300;
}
If (this.getField("Trailer").value == '86005') {}
Heel-22580 = Event.Value;
}
If (this.getField("Trailer").value == '86006') {}
Heel-22320 = Event.Value;
}
If (this.getField("Trailer").value == '86007') {}
Heel-21980 = Event.Value;
}
If (this.getField("Trailer").value == '86008') {}
Event.Value = heel-23180;
}
If (this.getField("Trailer").value.toUpperCase () == 'T602') {}
Heel-14060 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-602') {}
Heel-14060 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 'T603') {}
Heel-16420 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-603') {}
Heel-16420 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == "T610") {}
Heel-21900 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-610') {}
Heel-21900 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 'T611') {}
Heel-20940 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-611') {}
Heel-20940 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == "T621") {}
Heel-17180 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-621') {}
Heel-17180 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 'T702') {}
Heel-19900 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == 't-702') {}
Heel-19900 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '2R339') {}
Heel-11280 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '2R338') {}
Heel-11200 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '2R357') {}
Heel-11200 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '2R358') {}
Heel-11200 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '1R793') {}
Heel-13360 = Event.Value;
}
If (this.getField("Trailer").value == '8058') {}
Heel-22480 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '1R504') {}
Heel-13200 = Event.Value;
}
If (this.getField("Trailer").value.toUpperCase () == '1R553') {}
Heel-13300 = Event.Value;
}
If (this.getField("Trailer").value == '4180') {}
Event.Value = heel-13090;
}
ElseIf (this.getField("Trailer").value.toUpperCase () == 'GATX060903')
{
Heelc-75900 = Event.Value;
}
ElseIf (this.getField("Trailer").value.toUpperCase () == 'UTLX902219')
{
Heelc-83100 = Event.Value;
}
ElseIf (this.getField("Trailer").value.toUpperCase () == 'UTLX902227')
{
Heelc-83200 = Event.Value;
}}

on the other
Event.Value ="";

Replace all instances of this.getField("Trailer").value by this.getField("Trailer").valueAsString...

Tags: Acrobat

Similar Questions

  • Format custom text field only when the field is filled

    I have created a form that I need to have the format of a text field "model:"& value of text field, then when it is empty so it is just empty.»

    I put event.value = "template:" + event.value; "." in the format custom properties of the text field it set to format correctly, but if it had not entered in this field he said always model: so what should I do for it to be only occur when there is something entered in the field.

    Change to:

    If (event.value) event.value = "template:"+ event.value; ".

  • How do I run a script only if the field is not empty

    How do I run a script only if the field is not empty

    Well well, thanks to you, I had a full date on separate days, the months and the years in different areas. But now, I have a problem, as PDF has several fields calculated with script if you enter the date calculated by all other areas, which have separated and undefinied gives me does not want to put this to not always use this field. I tried to put one conditional if else but I sale. Esto, this is what I'm wearing

    var datesol = event.value;//declaramos the variable

    If (datesol = "") {}

    this.getField('yearsol').value = "";

    this.getField('monthsol').value = "";

    this.getField('daysol').value = ""}

    else {}

    var array_datesol = datesol.split("/"); / / separamos esa con date the split funcio

    this.getField('yearsol').value = array_datesol [2];

    this.getField('monthsol').value = array_datesol [1];

    this.getField('daysol').value = array_datesol [0];

    With what they do not separate them now.

    Help please

    As mentioned, you cannot use

    If (datesol = "")

    because that sets the value of datesol to «» (you will need to double for the comparison operator =)

    If you want to run code only if it is NOT empty, while it takes:

    If (datesol <> "")

  • JavaScript to make the fields to fill in the form read-only?

    How the fields to fill out my form read-only? I created the form, send to clients. Clients fill out the fields and click the submit button. The submit button pulls an automatically generated email and send the pdf file. I want the pdf file to send with the fields read-only. How then?

    This code should do the trick:

    for (var i=0; i		   
  • With the help of javascript code to validate content in the text field only if the field is visible...

    I have a "Lock of all areas" set up button and it took to run only if some fields are filled. The code works fine... except TextField13 does not validate correctly. TextField13 is encapsulated in a subform, titled busjus. The busjus subform is hidden at the disposal of the default form (it becomes visible only when a user selects some text in a drop-down list). I want the code to check if TextField13 is null only if the busjus subform is visible.

    The problematic part of the code that does not work as expected is listed below:

    partiv.nonflow.busjus.presence == visible) && partiv.nonflow.busjus.TextField13 == null ||  

    Complete code is listed below:

    if(partiandii.parti.TextField2.rawValue == null || 
    partiandii.parti.TextField1.rawValue == null || 
    partiandii.parti.DropDownList5.rawValue == null ||
    //Part II: Current Job Details
    partiv.nonflow.busjus.presence == visible) && partiv.nonflow.busjus.TextField13 == null ||  
    partiandii.partii.NumericField2.rawValue == null ||)
    {
        app.alert('Please complete all fields marked with a red asterisk and try clicking the button again.');   
    }
    else {
        myScriptObject.LockAllFields(form1);
    }
    

    Hello

    At a glance, I believe that this piece must include the rawValue call

    partiv.nonflow.busjus.TextField13
    

    This should be

    partiv.nonflow.busjus.TextField13.rawValue

    so that you compare the text in the field instead of the actual field object.

    Hope this helps

    Malcolm

  • Is it possible to store my files only on the reader to iCloud without storing them on my local HD?

    Is it possible to store my files only in iCloud drive without saving them to my local hard drive?

    iCloud Drive is not intended to replace your HARD drive or backup to the backup drive. It should be used with documents iWork and iDevice.

  • perform Validation only if the field is editable

    Hello

    I have a drop-down list (options A, B and C) and a text field in my form.

    If I select A or B, the field is automatically filled with 1 and 2 and will be no editble.

    However, Option C is activated in my drop down menu, the text field becomes editable and must accept values greater than 10 only.

    How can I run a rule of validation only if the C Option is selected in the drop-down list.

    Kind regards

    bnkr

    Hello

    You can add a validation rule to the level of the entity for the attribute with the expression of something like

    if( == "C")
      if( >= 10) return true;
        else return false;
    return true;
    

    Arun-

  • Show LOV only when the field is empty

    Hi all
    My surroundings:
    Oracle 10g on Windows
    Forms [32 bit] Version 9.0.4.1.0 (Production)
    Oracle Database 10 g Enterprise Edition Release 10.2.0.5.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options
    Oracle Toolkit Version 9.0.4.1.0 (Production)
    PL/SQL Version 9.0.1.5.1 (Production)

    My problem:
    I have a field in a block, which is text_item and is linked to an element of LOV. I want the LOV appears automatically, whenever I tab in there, only when the element is EMPTY (for example when I try to insert in the block). When, upon request, it should show only the value in the field, and user can choose to activate the LOV, by pressing F9, if she wants to. It now displays automatically each time text agenda is a debate (works very well when the user is inserted, but annoying when she questioned the shape and trying to tab thru.) Every time she focuses on the field, LOV is popping up!)

    The current setting for the property on the element of text field: Type: text element
    The list of values: MY_LOV_NAME
    Validation of list: Yes

    Properties on MY_LOV_NAME
    Auto display: Yes

    Any suggestions? Or trigger level I can use, and if so, what build_in can use?
    New forms and will greatly appreciate advice from pros!

    Thank you
    Libran_girl

    It's very simple,

    IN once - new - item - Instance

    DECLARE
    V_LOV BOOLEAN;
    BEGIN
    IF: NOM_ELEMENT IS NULL
    THEN
    V_LOV = SHOW_LOV (LOV_NAME);
    END IF;
    END;

    Try it, you will get your result, if it doesn't work, try: block_name.item_name

    Abbas

  • "Only if" the fields to complete

    Hi, I create fields to fill out a form in which the existing values are to be completed only when a check box is selected.

    My problem is the following:

    Page1

    [name] (manually updated)

    [Name] (manually updated)

    [Address] (manually updated)

    [etc.] (manually updated)

    [etc.] (manually updated)

    Page2

    [x] [name] (Self compiled from the previous field)

    [Name] (Self compiled from the previous field)

    [Address] (Self compiled from the previous field)

    [etc.] (Self compiled from the previous field)

    [etc.] (Self compiled from the previous field)

    [[name]] (empty field because none check box)

    [Name] (empty field because none check box)

    [Address] (empty field because none check box)

    [etc.] (empty field because none check box)

    [etc.] (empty field because none check box)

    Of course if you check the second box will be empty the field name, address, etc... on it whereas it should stand-alone compiled below.

    I don't know if you understand well with my Italian and translated the problem I have, you can do something like this in adobe professional?

    Let's say that your (first) box is called CopyDetails1. As the MouseUp event, use something like this:

    If (getField("CopyDetails1").value == "Off") {}

    reset this field group

    getField("Name1").value = "";

    getField("LastName1").value = "";

    etc.

    } else {}

    Copy the values of the fields on the first page

    getField("Name1").value = getField("Name").value;

    getField("LastName2").value = getField("LastName").value;

    etc.

    }

    Of course, you may need to adjust the names of the fields, but I think you can see the principle.

  • Make the form read-only if a field is filled

    Is there a way to do an entire form read-only if a certain text field is filled?  I know that adding a digital signature to a form field, increases the size of the screen, so I prefer not to add a digital signature field in my form.  However, I would like the feature that says after the form is signed, it is read-only.  I have added a text box to the form and tried to add a script that read: if (this.rawValue! = "") (this.access = "readOnly"), but it did not work.  Is there a way I can accomplish this without adding a signature to the form field?

    Hello

    It depends on where you have placed the script, probably the best place is the exit event.

    if (this.rawValue != null || this.rawValue != "")
    {
         this.access = "readOnly";
    }
    else
    {
         this.access = "open";
    }
    

    It blocks only the field that the script is inside.

    You should check the example of Paul LockAllFields, which contains a function in a script object. Whereas Paul calls it a click to a button event, you could call it the output of the particular text field event.

    Re: Save form non-fillable PDF

    Hope that helps,

    Niall

    Ensure the dynamics

  • Is it possible to assign a replacement or replacing the Volume License Administrator?

    I would like to be able to assign a different "named user" in order to perform necessary VLM tasks during the long absences of work - like illness or vacation.  Doesn't it?

    Hi DEPutman,

    You can absolutely add another administrator to volume license you VLA. You need just email to [email protected] with your contract number and let them know that you want to add.

    Take care!

  • Is it possible to display a dialog box with the fields/custom controls for the Windows Vista login screen to the top.

    Hello

    In Windows XP (prior to Windows Vista), a Service could be interactive and display a window/dialog on the login screen.

    Of course services are no longer allowed to be interactive, and certainly, I agree that it is an improvement in security.

    However, say if I wanted to do one of the following values, which is possible (and how to implement). I don't mind what language I have to set in.

    (1) add a button in the login screen that says "Reset Password" which will then invite a form with questions of security.

    (2) run an application within the login window

    Really appreciate any help on this matter,

    Mark

    Hi Mark,

    The question you posted would be better suited in the MSDN Forums; We recommend that you post your question in the MSDN Forums to get help:

    http://social.msdn.Microsoft.com/forums/en-us/categories

    See the following for more information Microsoft article.

    http://blogs.msdn.com/b/securitytools/archive/2009/07/30/how-to-build-custom-logon-UI-s-in-Windows-Vista.aspx

    http://blogs.technet.com/b/Aho/archive/2009/11/15/custom-credential-provider-for-password-reset.aspx

    Keep us updated on the status of the issue.

  • I need to calculate a formula of a given field, only if another field is filled first

    I have 3 domains that need to interact with them.  "" "VNP1" needs to calculate "ColumnInches" x 14 x.395, but only when ""VNRD1 "is filled."  How would I do that with javascript?

    Use this code in the custom calculation of VNP1 script:

    if (this.getField("VNRD1").valueAsString=="") event.value = "";
    else event.value = Number(this.getField("ColumnInches").value) * 14 * 0.395;
    
  • Assign a spacing equal to the fields in the horizontal field Manager

    Hello

    I add a number of vertical field managers to a horizontal field Manager. Each manager of vertical field has a text with an image under. The text varies in width images in each vertical field Manager seem to have a different amount of space between them. Is there a way to remedy this situation? Joined a raw image in the way that message on the screen. How can I get the same amount of space between each area of the rectangle?

    Thank you

    Here's some code that I received from one of the sessions at the last DevCon.  Should be useful.  Might help explain customer managers too.

    /*
     * EqualSpaceToolbar.java
     *
     * Research In Motion Limited proprietary and confidential
     * Copyright Research In Motion Limited, 2009-2009
     */
    
    import net.rim.device.api.ui.*;
    
    public class EqualSpaceToolbar extends Manager {
    
        private static final int SYSTEM_STYLE_SHIFT = 32;
    
        public EqualSpaceToolbar() {
            this( 0 );
        }
    
        public EqualSpaceToolbar( long style ) {
            super( USE_ALL_WIDTH | style );
        }
    
        protected void sublayout( int width, int height ) {
            int numFields = getFieldCount();
            int maxHeight = 0;
    
            // There may be a few remaining pixels after dividing up the space
            // we must split up the space between the first and last buttons
            int fieldWidth = width / numFields;
            int firstFieldExtra = 0;
            int lastFieldExtra = 0;
    
            int unUsedWidth = width - fieldWidth * numFields;
            if( unUsedWidth > 0 ) {
                firstFieldExtra = unUsedWidth / 2;
                lastFieldExtra = unUsedWidth - firstFieldExtra;
            }
    
            int prevRightMargin = 0;
    
            // Layout the child fields, and calculate the max height
            for( int i = 0; i < numFields; i++ ) {
    
                int nextLeftMargin = 0;
                if( i < numFields - 1 ) {
                    Field nextField = getField( i );
                    nextLeftMargin = nextField.getMarginLeft();
                }
    
                Field currentField = getField( i );
                int leftMargin = i == 0 ? currentField.getMarginLeft() : Math.max( prevRightMargin, currentField.getMarginLeft() ) / 2;
                int rightMargin = i < numFields - 1 ? Math.max( nextLeftMargin, currentField.getMarginRight() ) / 2 : currentField.getMarginRight();
                int currentVerticalMargins = currentField.getMarginTop() + currentField.getMarginBottom();
                int currentHorizontalMargins = leftMargin + rightMargin;
    
                int widthForButton = fieldWidth;
                if( i == 0 ) {
                    widthForButton = fieldWidth + firstFieldExtra;
                } else if( i == numFields -1 ) {
                    widthForButton = fieldWidth + lastFieldExtra;
                }
                layoutChild( currentField, widthForButton - currentHorizontalMargins, height - currentVerticalMargins );
                maxHeight = Math.max( maxHeight, currentField.getHeight() + currentVerticalMargins );
    
                prevRightMargin = rightMargin;
                nextLeftMargin = 0;
            }
    
            // Now position the fields, respecting the Vertical style bits
            int usedWidth = 0;
            int y;
            prevRightMargin = 0;
            for( int i = 0; i < numFields; i++ ) {
    
                Field currentField = getField( i );
                int marginTop = currentField.getMarginTop();
                int marginBottom = currentField.getMarginBottom();
                int marginLeft = Math.max( currentField.getMarginLeft(), prevRightMargin );
                int marginRight = currentField.getMarginRight();
    
                switch( (int)( ( currentField.getStyle() & FIELD_VALIGN_MASK ) >> SYSTEM_STYLE_SHIFT ) ) {
                    case (int)( FIELD_BOTTOM >> SYSTEM_STYLE_SHIFT ):
                        y = maxHeight - currentField.getHeight() - currentField.getMarginBottom();
                        break;
                    case (int)( FIELD_VCENTER >> SYSTEM_STYLE_SHIFT ):
                        y = marginTop + ( maxHeight - marginTop - currentField.getHeight() - marginBottom ) >> 1;
                        break;
                    default:
                        y = marginTop;
                }
                setPositionChild( currentField, usedWidth + marginLeft, y );
                usedWidth += currentField.getWidth() + marginLeft;
                prevRightMargin = marginRight;
            }
            setExtent( width, maxHeight );
        }
    
    }
    
  • vSphere only allow the field to be disarmed

    While the resolution of other problems for esxi, I used vSphere to define 'domain' of my installation (host-> Configuration-> DNS and Routing tab).

    Now my performance graphs show not all the data and its been like this for more than an hour.

    If I try to go back in the same screen, I can't white field, as the 'OK' button remains disabled. If I try to enter just a space for the domain (which activates the button), and then he complained his invalid characters

    How can I cancel setting the field?

    Simply define a nem to the "working group", a different domain name. You can't leave it empty!

Maybe you are looking for