Else if then statement help

Hi, I'm doing a script for a submit by email button pick up two fields of the subject - an id and the date line.  The problem is there are two date fields and I want only to pick up one of them.  So if the first is empty (that is, "home_insert_date") he will get the second one (i.e. "apt_insert_date"), and if the first is filled, then it will ignore the other.

Here's the current code that I have.

var parts = getField("newspaper_flyerid").value + '-' + getField("home_insert_date").value + getField("apt_insert_date").value
this.mailDoc({)
cTo: " [email protected] ", "
bassujetti: parts,.
});

Thank you very much!

Try this:

var part1 = this.getField("newspaper_flyerid").valueAsString;
var part2 = this.getField("home_insert_date").valueAsString;
var part3 = this.getField("apt_insert_date").valueAsString;

var subjectLine = part1 + "-";
if (part2=="" && part3=="") {
    subjectLine += "missing date";
} else if (part2!="") {
    subjectLine += part2;
} else subjectLine += part3;

this.mailDoc({
    cTo: "[email protected]",
    cSubject: subjectLine
});

Tags: Acrobat

Similar Questions

  • If then statement help

    Thanks in advance for your help. I work on a PDF form and has difficulty with a logical statement (If Then). Then the field (TotalEligibleServiceCatchup) should be the least of the three amounts: TotalElectiveSalaryDeferralMinusYearsOfServiceCatchup, LifetimeMinusCatchupAmount, or $3,000. In other words, if the Total salary deferral less years of Service catch-up is like $3,000 and life less amount of catch-up is greater than $3,000; the value of the calculated field is $ 3,000. If one or both of the first two values are less than $3,000, the calculated field is the least of these values.

    Thanks in advance for your help.

    In this case, you can use this code as the custom of your domain calculation script:

    var v1 = +this.getField("TotalElectiveSalaryDeferralMinusYearsOfServiceCatchup").valueAsString;
    var v2 = +this.getField("LifetimeMinusCatchupAmount").valueAsString;
    event.value = Math.min(3000, v1, v2);
    
  • New on Adobe need help with an if then statement

    Hi, I really like what ADOBE Pro 9 can do with forms and neat and everything is included.

    I'm having a problem trying to understand an if then statement for one of my forms and how to make it executable.

    Here is what I have

    I.          Cigna Medical                                           

                (10)       single                                     $  44.00

                (11)       Employee & Child (ren)              $  82.00          

                (12)       Employee & Spouse                 $  99.00                      

                (13)       Family                                     $125.00                      

                (14)       Decline Coverage                         $0.00          Choice: _        Amount: $_

    An employee will be choice an optiopn 10-14 and but that number of choices. After I am about to fill with this number.

    For instnace, if an employee takes option 11, choice: 11 and amount: $ 44.00

    I put the options in a menu drop-down. The drop down menu is titled CignaMedical and Amount_1 title for amount: $_ and I made a text box.  I put this code: if (this.getField("CignaMedical").value == '10') {}
    Amount_1 = 44.00} tab calculation of properties for the Amount_1 of text box on the custom calculation script tab.

    Any help is greatly appreciate

    Yes, you can use an if-else if construction. Something like that (I got the first part because we reuse it):

    CignaMedical = this.getField("CignaMedical").value;

    If (CignaMedical == '10') {}

    44.00 = Event.Value;

    } Else if (CignaMedical == "11") {}

    Event.Value = 82.00;

    } Else if (CignaMedical == '12') {}

    99.00 = Event.Value;

    }

    etc.

  • If/Then statement to date null in Acrobat DC

    I work in Acrobat DC, I have a document which is 6 pages long, the first page is in English, the other in Spanish.

    I have two date fields, one is named AssessmentDate and the other is LongAssessDate. AssessmentDate displays the date in English in mm/dd/yy format on the first page.

    The LongAssessDate field converts the date in the field of the AssessmentDate in a Spanish format. For example if the Valuation Date
    24/05/15 then the date is converted to this format = 24 Mayo of 2015.

    Here is my code:

    oField var = this.getField ("AssessmentDate");

    oDateObject = util.scand ("mm/dd/yy", oField.valueAsString);

    Event.Value = util.printd ("date (es) {DD ' of 'MMMM' to ' YYYY}", oDateObject, true);

    What I found is, if the user does not have a date in the AssessmentDate field (they leave empty), the current date watch in the
    Field of LongAssessDate.

    I think I need an if/then statement for the LongAssessDate field. If the value of AssessmentDate is null or empty, then the LongAssessDate field must be null/empty, but don't know how to proceed. Any help is greatly appreciated.

    Thank you, Jamie

    This should work:

    var sDate = this.getField("AssessmentDate").valueAsString;

    If (sDate) {}

    oDateObject = util.scand ("mm/dd/yy", sDate);

    Event.Value = util.printd ("date (es) {DD ' of 'MMMM' to ' YYYY}", oDateObject, true);

    } else {}

    Event.Value = "";

    }

  • If/then statement

    I am designing a form that has 2 columns and I am looking for a script to fill a column based on data in the other.  Specifically, if classes has, B, C, D are entered in the column on the left, then the right column filled with 3 hours of credit.

    I took a fairly simple if/then statement... Found one in the help section of my software, plugged, named fields properly in the object palette and in the script.  No go.

    Book Terry JT not useful and my computer is not versed in Java.

    Or, maybe I'm doing it too hard and FormCalc would be the right choice?

    Thank you!

    Hi Milly,.

    You didn't say what else is in the grade or the opportunities that lay is A +, B-, etc. AND they are in a table row. I suppose they are in a table. I think on a drop-down list for the grade box. That said, this might work for a drop-down list box or a text field containing the grade (depending on how you have the menu drop-down set up) or this script is changed for a drop-down list containing the digital item values in the 'Connection' tab easily. It lends itself to the computer GPA (if it is an ultimate goal).

    Grade Credit
    A 3
    C 3
    F 0
    A 3

    The script is quite easy.

    Make sure you place this on the calculate of the "credit" field event AND formCalc is the language:

    ////////////////////////////

    If (rank< "f")     ="">

    $ = 3

    on the other

    $ = 0

    endif

    ////////////////////////////

    If there is + or - grades, you could use

    ////////////////////////////

    If (Substr (grade, 1, 1)<  "f")     ="">

    $ = 3

    on the other

    $ = 0

    endif

    ////////////////////////////

    La: Substr(grade,1,1) from the 1st letter of the slope and uses for comparison

    Replace with the name of your field of rank for the "rank" above and you should be good to go.

    Good luck

    Stephen

  • If - then statements (k)

    Honestly, I don't know how to write any PHP, but I don't know how to create a PHP website in Dreamweaver because DW wrote all the PHP for me.

    I think that I now need to get out a bit of Dreamweaver. What I would do is:
    If the variable width = 800, so I want to show a specific hidden layer.
    If the variable height = 800, so I want to show a specific hidden layer.

    I could do that in a second in ActionScript, but I have no idea how to go about this in Dreamweaver.

    How would one write an If - then statement?

    Don't forget, all this PHP code that creates DW is like hieroglyphics to me.

    Thank you
    -Kirk

    xparrot_dude wrote:
    > I'm not having much luck. I don't know where to put the if-then you have written or if
    > the $width is a standard PHP type thing or if it is a variable.

    It is a variable. In PHP all variables begin with a dollar sign.

    > Here's what I tried:
    >
    ><>
    > If ($width == 800) {}
    {$show > visible =}
    > {else}
    $show > = hidden
    > } ?>

    You would not assign a string to a variable in ActionScript without using
    quotes. It goes the same for PHP. In ActionScript, the semicolon at the end
    a statement is optional (but recommended recommended). In PHP, there
    mandatory.


    <>
    If ($width == 800) {}
    $show = 'visible' ;}
    else {}
    $show = 'hidden ';
    } ?>

    > I then put the $show variable in my css, like this:
    > #HorizontalPhoto {}
    > position: absolute;
    > left: 53px;
    > top: 159px;
    > width: 317px;
    > height: 172px;
    > z - index: 1;
    > visibility: $show;
    > }

    The only thing that can go in CSS is CSS. If you want to use PHP, you
    must surround yourself with PHP tags and use echo or print to the output of the
    the value of the variable.

    visibility: ;

    > Please keep in mind that I've never written ANY PHP. So I don't know if I
    > need the tags or even where I can and can not put code.

    Everyone is a beginner at one point, but you will get better help if you
    make an effort to begin to learn some PHP basics yourself. A good place
    to start is with the official PHP tutorial:

    http://docs.php.net/manual/en/getting-started.php

    You will also find the PHP language useful reference, especially if
    you are already familiar with ActionScript. The two languages share many
    in common:

    http://docs.php.net/manual/en/langref.php

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to do an if then statement on a PDF form

    I'm doing an if then statement on a PDF form.

    The field is a field A * B = C.  If C < 10 then C = 10, of another C = A * B

    How can I write the Adobe Pro is on a PDF form?  I went into properties, the calculated field and nothing I've tried works.

    Each field is a separate object, so if you have 3 fields such as 'A', 'B' and 'C' are a single object has a unique value. Each field must be consulted individually, you should get the value in field "A" in a statement, the value of the field 'B' in another statement.

    var C = this.getField ('A') .value * this.getField("B").value;

    If (C)< 10="" )="" event.value="">

    else event.value = C;

    You can see more clearly with code like:

    var A = this.getField ('A') .value; the value of a field;

    var B = this.getField ('B') .value; the value of field B;

    var C = A * B; the field value has multiplied by the value of the field B;

    If (C)< 10="" )="">

    Event.Value = 10; the value is 10 when produced less than 10;

    } else {[]}

    Event.Value = C; another value is the product;

    }

  • Dictionary stats help?

    DBA dear friends,

    In my 11.1.0.7 database, I have an ID of SQL which contributes about 100 reads physical Mil a day in the database, he ran 85 times in the 24 hour period.

    Here is the SQL - it accesses the SYSTEM tables and EM monitors query type, and is not a request part of the application-

    Dictionary collection stats help reduced the physical reads? Or any other point of view that what must be considered?

    Is it still worth to try tuning the query?  Please share your entries...

    SELECT 'AQ_Messages_in_Expired' t. *
    Of
    (select q. owner | | '.' | | q . name , v. expired
    de v$aq v, dba_queues q

    v. QID = q. QID and q. owner not in ('SYS','SYSTEM','WMSYS') and q. QID not in (206397, 206398, 206325)) t

    I don't see a MERGE JOIN CARTESIAN, which is good.  I do not see a stage for fixed table and it MIGHT help generate fixed objects statistics:

    exec dbms_stats.gather_fixed_objects_stats (null)

    You can see if they have been already generated by querying the SYS. TAB_STATS$:

    Select count (*) in the sys.tab_stats$;

    If it is empty then stats fixed objects have not been met.  Stats of $ service must be collected by the work of database statistics 'standard '.  You can collect these stats and run the query again to see if the run time is improving.  You can also check when the last statistics, what are the sample sizes and how closely NUM_ROWS agrees with a count (*) current tables questioned.

    David Fitzjarrell

  • If then statements

    Greetings,

    I use Adobe Acrobat Pro XI.  I have a drop down list which has the value 'Yes' or 'No' I would like to create an If Then statement to return specific values in another field of text based on the value of the drop-down list box.  Specifically, if the value of the 'drop-down list' = 'no', then the value of the "textfield2' will be 'n/a '.  If the value of the drop-down list is 'Yes', then the value of the "textfield2" remains empty if the applicant can enter data into "textfield2.

    Hope it makes sense.  Thank you in advance.

    Steve

    Use this code in the script validation custom from the drop-down list:

    If (event.value == "No") this.getField("textfield2").value = "n/a";

    else this.getField("textfield2").value = "";

    Make sure that check the option to validate the value selected from the drop-down list immediately (under Properties - Options).

  • I can't erase unnecessary files on my Mac Pro by pressing option, command, and then J.  Help, please.  Thank you

    I can't erase useless files more pressing option, command, and then J.  Help, please.  Thank you

    option, command, and then J is not listed as a shortcut KB

    here:

    Keyboard shortcuts in Mac - Apple Support

  • To what size, we can use if and else in HFM statements rules?

    Hi Experts,

    To what size, we can use if and else in HFM statements rules?
    (Scenario, year, time, account, PKI, value, view, entity, Custom1, Custom3, Custom3, Custom4)

    concerning
    Dev
  • If then statement - hide the field 0 and counting! Help!

    OK, I try to have the Cap RATE: to do a number of things. On the side of first note, in the Privileged Postion there drop down there has 4 options, 1 fixed, 2 ch, HELOC 1st and 2nd HELOC. I'm figuring the CEILING using the APOR , if the Position of privilege claims fixed 1st or 2nd set only. So that the calculation of the ceiling RATE should read something like this, IF (States ofPrivilège Position : Fixed 1st or 2nd set then ADD (fixed 1 IF add 1.5% IF the 2nd ch ADD 3.5%) rate APOR (users will enter rate APOR).)

    EXAMPLE:

    Position of privilege: 1st set

    APOR: 3.48%

    (because it is the 1st ch)

    + 1.5%

    CAPP RATE = 4.98%

    EXAMPLE 2:

    Position of privilege: 2nd set

    APOR: 3.48%

    (because it is the 2nd ch)

    + 3.5%

    CAPP RATE = 6.98%

    Also, I want the CEILING to be TRANSPARENT or WHITE if there is no rate entered MRPS because it's to RATE FIXED ONLY.

    Capture.JPG

    Any help is greatly appreciated!

    Ok

    This can be done easily with a FormCalc script in the calculate the rate ceiling field event.

    Assuming that the other fields are named LienPostion and MRPS, the script looks like:

    if (LienPosition eq "1st Fixed") then
              APOR + 1.5
    elseif (LienPosition eq "2nd Fixed") then
              APOR + 3.5
    else
              APOR
    endif
    
  • I need help with Java Script if/then statement

    I have absolutily no experience writing Java Script any help at all would be appreciated.

    I am working on a form in which I need a box for the person filling out the form click if they are a company be exempt from taxes. Well, obviously when they check the box I need field sales tax to change $ 0.00 total cost will only be calculated on the price of the items.

    Currently I use steps in the field of calculation for my Salestax.

    var k = this.getField ("SubTotal");

    K.value = Event.Value * 0.0825;

    Yet once, all possible assistance would be greatly appreciated.

    Tiffany

    Let's say the name of the box is "IsTaxExempt". Then you can use this code as the field of Salestax calcluation:

    If (this.getField("IsTaxExempt").value == "Off") {}

    var k = this.getField ("SubTotal");

    K.value = Event.Value * 0.0825;

    } else event.value = 0;

  • When I open the bookmarks, the locks of browsers computer for a short period of time, then bookmarks is very slow. Everything else works fine? Help?

    The bookmark will open in firefox and see the full list, but as soon as he opens the mouse freezes and nothing works for a minute, almost as if the system is looking for something? Then when I go back function mouse scrolling of the bookmark is very slow at best? I remove firefox version 41 and re-installed without help. Anyone having this isse now? Thank you!

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

    Separate the issue;
    Shows details of the system;

    Plug-ins installed

    FortiClient SSLVPN CacheCleaner Firefox Plugin
    FortiClient SSLVPN CacheCleanerEx Firefox Plugin

    Having multiple versions of a program can cause problems.
    You must remove older programs. Then download the current full installer.

  • using nest if then statements using ABM

    I have a two input, 1 output circuit, as in the attached schema. My third node is set down by the very high resistance voltmeter. What I have is a user defined current source ABM that depends on other parameters in the circuit. I wonder it is what my conditional statement is entered in the right format? Conditions are particularly complex and describe as follows:

    If the voltage difference between V2 and U1 is greater than 0, then the current in the ABM = 10 ^-12

    If this voltage difference that the above is not greater than zero and if (V (1) u (1))<(V(2)-U(1)), then="" the="" abm="" current="" is="">

    Otherwise, if (V (1) u (1)) > = (V (2) u (1)) then the current is (0.1*((-(V(2)-U(1)))^0.35))*0.00001596*(((V(2)-U(1))^2)/2)

    As you can see, they are very complex conditions and my concern is that I can't just type in U1 and get the compiler to understand I want the voltage read on the voltmeter of bottom-node. I think I'm using the correct nesting in the encoding format is: if (T, X, (if(Q,R,S))).

    Any help would be appreciated, and details can be provided.

    I don't know why its not throwing an error for the use of u (1), maybe it's a valid keyword.

    If you want to reference a voltage properly, it should be V (net_name) for single ended voltages (referenced to ground) or V (net1, net2) for differential voltages... For models ABM I suggest turning on net visibility throughout the schematic so that you know the net name to the positive terminal of U1 or anywhere else for that matter.

    I think the syntax you have to if/then/else is correct otherwise.

    Kind regards
    Pat Noonan
    National Instruments

Maybe you are looking for

  • EliteBook 8440p: reinstall applications preinstalled after upgrade

    I had all these applications pre-installed, as the DVD Roxio Creator (not sure if it's real name) and after the upgrade to Windows 10, all of these applications have disappeared. How to make a comeback?

  • How to cancel an old iPhone to my Apple/iTunes account?

    I have an iPhone 4 that I do not use and will be trade on the Apple Store, I've now upgraded to a 6 s. I noticed other day who "find my phone" said: I have two iPhones. I'll restore the old iPhone 4 parameters. Will be - this separate the phone with

  • I can't configure my touchpad.

    anything in Control Panel, 'mouse' on the touchpad settings. Dell help, windows help, saying the same thing. I do not scroll or by moving laterally, as I have when I got this dell laptop.

  • VISTA update to SP2

    I just tried to update my system Windows VISTA with Service Pack 2 from the Microsoft Downloads.  Update seems to work and I started to date of message 1 of 3 and 2/3 update before you get a message that did not update.  Now, the whole system is almo

  • Impossible to change the wallpaper on Windows 7 after you uninstall Bing Desktop

    Original title: cannot change the wallpaper on Windows 7 after you uninstall Bing Desktop I installed desktop Bing a few months back, but I'm tired of his daily wallpaper and decided to uninstall it. Now I can't apply themes and wallpapers. When I pu