Calculated field hidden when field is blank

This is actually similar to a discussion from a few months ago.Our forms are intended to be filled out online, printed and e-mailed, faxed, or snail-mailed. Many times the customer will simply print out the form and fill it out by hand. When I create forms with calculations the "$" or "0.00" appear; thus making it difficult for someone filling the form out by hand to work around those symbols/numbers. A few months ago, I had a similar situation involving percents and the gurus on this forum (Thank you, gurus!) helped me with the following code and it worked perfectly at hiding the calculated fields unless something was entered in the fields to be calculated.
For a field with a format of "None" user a Custom validation script:
if(event.value == 0) {
event.value = ""; // set field to null;
AFNumber_Format(0, 0, 0, "", "", true); // set format to number 0 decimals, no currency;
} else {
event.value = event.value; // keep value;
AFPercent_Format(2, 0, 0); // set percent format 2 decimal places.
This time, the problem involves simple numbers (not percent, not currency). I used the same logic and the fields actually show/hide like I want, but the numbers need to be formated with a comma separating the thousands and a decimal point with two digits after. I can't figure that out! Can someone please offer some advice? Thanks in advance for your help.

Make sure you are using the correct quotation marks. Use either the double quotation marks or the single quotation marks and not 4 single quotation marks.
if(event.value == 0) {
event.value = ''; // set field to null (2 single quotation marks);
Supress Zero

Similar Messages

  • How to keep a calculation field blank until the user enters a number?

    I am building a sales sheet for a school that sells scrip as a fund-raiser. I have the document set so that when the user enters the number of scrip certificates he wants (say, two $25 gift certificates at Lowe's), the program will automatically calculate that this user owes $50 for that scrip category. However, there are more than 100 companies that one can choose from, and if the user doesn't enter a number, the calculated field shows $0. Is there a way that each field can stay blank until the user enters a number bigger than zero? By the way, I'm using this calculation to determine the value (borrowed from a user on this forum): event.value = 50 * this.getField("Lowes").value
    Thanks!

    There are two approaches. You can either add the following Validate script:
    // Custom Validate script for calculated field
    if (+event.value !== 0) event.value = "";
    Or you can change your custom Calculate script and set the Format type of the field to "None":
    // Custom Calculate script
    (function () {
        var v = +getField("Lowes").value;
        event.value = (v !== 0) ? util.printf("$%.2f", v) : "";

  • How Do You Change A Numeric Field To Blank When Zero?

    I'm using Adobe Acrobat 6.0 Professional, version 6.0.6.
    Can anyone help me with the code to change a numeric field to blank, when "0.00"?

    "no success" does not provide much to go on.
    With your scripts, I get the concatenation of the sting values, so one has to force JavaScript to convert strings to numbers.
    Make sure your field names are exact including case.
    Make sure the calculation order is correct.
    The following scripts all work:
    var fa = 1 * this.getField("FeeN01").value;
    var fb = 1 * this.getField("FeeN02").value;
    var fc = 1 * this.getField("FeeN03").value;
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    // or
    var fa = this.getField("FeeN01").value / 1;
    var fb = this.getField("FeeN02").value / 1;
    var fc = this.getField("FeeN03").value / 1;
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    // or
    var fa = Number(this.getField("FeeN01").value);
    var fb = Number(this.getField("FeeN02").value);
    var fc = Number(this.getField("FeeN03").value);
    event.value = fa + fb + fc;
    if ((event.value == 0)) {
    event.value = ""
    The "sum of" also works with the "Custom validation script" of:
    if (event.value == 0) event.value = "";

  • Go to a Website no longer disappears when cursor in blank field

    Normal windows standards dictate that an empty field show blank when a cursor is put in it. However, starting with FF15, the Go to a Website verbiage does not disappear. Is there a config to make this go away? Confusing, because your never sure quickly if the cursor went into the field.

    "The placeholder will only disappear after you have typed at least one character." What?! Are you kidding me?!! This is not acceptable!
    I restored my computer just to go back to Firefox 14.0.1, and then I shut off updates. And it's going to stay like that permanently until this is solved.

  • I have a fillable form that we send to contractors - when the form is opened on a computer the contractor can view the fields we have completed, however when viewing from a mobile device or cell phone those fields appear blank. Any suggestions? I am at a

    when the form is opened on a computer the contractor can view the fields we have completed, however when viewing from a mobile device or cell phone those fields appear blank. Any suggestions? I am at a total loss as it works when viewing from the computer. I am assuming it is a setting or maybe we need to save it a special way?

    What version of Reader are they using, exactly? And are you sure they're
    using Reader itself and not opening the file inside a browser window, for
    example?
    On Fri, Feb 6, 2015 at 5:24 PM, jessicao96457206 <[email protected]>

  • Trouble when attempting to Sum Calculated Field.

    I had to create a calculated field called RI_Limit which contains static data.  (Developers/DBA could not enter it into the database at this time, so this was a work around. 
    The calculated field is setup as such:
    =iif(Fields!Location_LOCATION_NAME.Value = "a", 8, iif(Fields!Location_LOCATION_NAME.Value = "b",2, iif(Fields!Location_LOCATION_NAME.Value = "c",0, iif(Fields!Location_LOCATION_NAME.Value = "d",0, iif(Fields!Location_LOCATION_NAME.Value = "e",1, iif(Fields!Location_LOCATION_NAME.Value = "f",1, iif(Fields!Location_LOCATION_NAME.Value = "g ",0, iif(Fields!Location_LOCATION_NAME.Value = "h",0,iif(Fields!Location_LOCATION_NAME.Value = "i",4,iif(Fields!Location_LOCATION_NAME.Value = "j A",0,iif(Fields!Location_LOCATION_NAME.Value = "k",0,iif(Fields!Location_LOCATION_NAME.Value = "l",7,iif(Fields!Location_LOCATION_NAME.Value = "m",0,iif(Fields!Location_LOCATION_NAME.Value = "n", 1, iif(Fields!Location_LOCATION_NAME.Value = "o",0, iif(Fields!Location_LOCATION_NAME.Value = "p",1, iif(Fields!Location_LOCATION_NAME.Value = "q",3, iif(Fields!Location_LOCATION_NAME.Value = "r",1, iif(Fields!Location_LOCATION_NAME.Value = "s",1, iif(Fields!Location_LOCATION_NAME.Value = "t",3, iif(Fields!Location_LOCATION_NAME.Value = "u",5,iif(Fields!Location_LOCATION_NAME.Value = "v",0,iif(Fields!Location_LOCATION_NAME.Value = "w",0,"NA")))))))))))))))))))))))
    and I setup a textbox with that expression and the numbers fill in correctly with its cooresponding site name.
    However, when I go to sub total or total, I get a much larger number than expected. (See screenshot)
    I have searched the internet on a way to calculate both the total by Location Level 2 and LOB total, but nothing that pertains to the specific issue where by calculated field contains static data.  Nothing I try produces an accurate sum.  Any suggestions?

    Hi Katherine,
    Sorry for taking a few days to reply.
    I tried the suggestion, but it it still not summing my calculated fields.  The total row will calculate my other cells okay but not the calculated fields that I had to add to the report.  When I attempted to write an expression to sum the calculated
    fields I get the following error message. 
    The expression used for the calculated field '=sum(iif(Fields!Location_LOCATION_NAME.Value = "test", 8, iif(Fields!Location_LOCATION_NAME.Value = "test1",2, iif(Fields!Location_LOCATION_NAME.Value = "test2",0, iif(Fields!Location_LOCATION_NAME.Value = "test3",0, iif(Fields!Location_LOCATION_NAME.Value = "test4",1, iif(Fields!Location_LOCATION_NAME.Value = "test5",1, iif(Fields!Location_LOCATION_NAME.Value = "test6 ",0, Fields!Location_LOCATION_NAME.Value = "test7",0,Fields!Location_LOCATION_NAME.Value = "test8",4,Fields!Location_LOCATION_NAME.Value = "test9",0,Fields!Location_LOCATION_NAME.Value = "test10",0,Fields!Location_LOCATION_NAME.Value = "test11",7,Fields!Location_LOCATION_NAME.Value = "test12",0,Fields!))' includes an aggregate, RowNumber, RunningValue, Previous or lookup function. Aggregate, RowNumber, RunningValue, Previous and lookup functions cannot be used in calculated field expressions.
    The Espression for the calculated field I am attempting to sum is the following:

  • Problem faced when using calculated field as filter

    Iam using an Oracle External Data Source.The external table contains a timestamp field and I add this to my data object.The year,month etc. functions work well on this field and results appear on list views.But when I try to generate a filter for this field and display the view I get errors.
    SQLSYNTAXERROREXCEPTION_REPORTSERVER_STREAMINGLIST_INITIALIZE
    Exception Message ORA-00904: "MONTH": invalid identifier
    So,I tried out with the call center data object found in bam samples.This had a datetime field.Filters on calculated fields work fine here.
    Is the former problem due to timestamp datatype or external datasource or anything else?
    Thanks,
    Raghuram

    Answer to following questions will help me narrow down the problem:
    1. Which version of BAM are you on - 10g or 11g?
    2. What condition are you using in filter i.e. "is equal to", "is less than equal to", "is like"...etc?
    3. In which format is the timestamp data being given in the filter? (by format, I mean mm-dd-yy HH:MM:SS etc)
    4. Can you give the exact datatype of the DB in which this timestamp data is stored?

  • A calculation field is defined too small when i am relasing the csotingrun

    Hi
    when i am releasing the standard price the system is showing  is dump as
    following  A calculation field is defined too small.
    Runtime Errors         BCD_FIELD_OVERFLOW
    Except.                CX_SY_CONVERSION_OVERFLOW
    Date and Time          04.12.2011 10:50:18
    Short text
        A calculation field is defined too small.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLCKMB" had to be terminated because it ha
        come across a statement that unfortunately cannot be executed.
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    can any body help me.
    thanks
    kareem

    Hi srinivas,
    thank you very much for ur answer,
    i checked that notes and sent me my basis guy.
    as he told me note 1103295 cant be implemented in this client as we are in support 700 packages.
    can you tell me any other way it can be resolve.
    thanks
    kareem

  • Data missing in Crosstab report with calculated field via case when

    I use the Oracle 10g discoverer. When I create a crosstab report with a calculate field via function case when and put it as datapoint, some of the data is not showing. I tried to not use the case when function for the calculate field, then all the data show.
    I really do not the reason. Could anybody help me out with many thanks?

    Let me explain more.
    I have the original data below.
    Work order, Team, Hours_worked, date
    800001, S1, 5, 2012/01/01
    800001, S1, 15, 2012/01/10
    800001, S2, 4, 2012/01/04
    800002, S1, 3, 2012/01/15
    There are multipul records for the same work order, team on the same day or different.
    Finally I want to set the start date and end date as the parameter to create a crosstab report format like
    start date>=2012/01/01 and close date<=2012/01/05
    Team
    Total hours total hours within the range
    Work order S1 S2 ... S1 S2 ...
    800001 20 4 5 4
    800002 3 0 0 0
    in order to do it, I create two parameters independently start date and close date. Then I create a calculate field hours_worked_withinrange via
    Case when date>=:start date and date<=:end date then Hours_worked else 0 end
    This calculated field is correct in the tabular format report in discoverer desktop. But when I duplicate the list as crosstab. Some data is missing in crosstab data point.
    I checked once I change the calculate field defination not use case when. (For example, C1=hours_worked*2). Then everything runs correct.

  • Displaying calculated field only when data exist

    Hello,
    Is there a way to display my calculated value only when the data entry field is being used. For instance, if I have several fields vertically aligned, I don't want to display a bunch of zeros if their data fields are not being used.
    THANK YOU!!!!

    You can check for the rawValue in the Calculate event before any script.
    Event: Calculate
    //FormCalc
       if(Field1.rawValue ne null) then
         // write your script here
       endif
    //JavaScript
    if(this.rawValue != null){
       // write your script here
    Thanks
    Srini

  • Is it normal that the DataSource field is blank when opening a master data

    Is it normal that the DataSource field is blank when opening a master data which is also an InfoSouce in InfoSource page.
    Just locate an InfoSource which is also a master data or data target where next to which is a green triangle picture icon in InfoSource page, open it, the top part (Commnication Structure) is automatically expended.  Expend the lower part "Transfer_Structure/Transfer_Rules", find the DataSource field is blank.  This only occurs for an InfoSource which is also a master data which have more than two data loads (e.g., one is attibute, and the other is text load) or there are two InfoPackage loads for this master data.  We checked for master data with only one InfoPackage under it (e.g., only text load) and find it's OK that the datasource field is not blank when expending the lower section.
    Thanks

    Kevin
    It's not common. If you have three Data Sources like attributes, texts and hierarchy by default attribute data source will appear on the screen and for the rest of the things we need to do dropdown and select. This is how in general it appears.
    Thanks
    Sat

  • Page hidden if a field is blank

    Is there a code I can input that makes a page "hide" if a field is blank?

    In Acrobat you make the hidden page a "template" and hide it. Then for your field you need to use either a validation script or on blur action to change the template from hidden to visible and if the field has its data deleted then you need to hide the template.
    var cTemplate = "myTemplateName"; // name of template to hide/show
    var t = this.getTemplate(cTemplate);
    if ( t != null )  {
    if event.value != ""  t.hidden = true;
    else t.hidden = false;
    } else app.alert("Template " + cTemplate + " not found", 0, 0);
    // end of non-null template name

  • ICloud asked me to reenter my password to get mail and when I did, it rejected my password. I'm trying to reenter in my account information, but it won't let me because the incoming mail server field is blank, but it won't allow me to enter anything.

    iCloud asked me to reenter my password to get mail and when I did, it rejected my password. I'm trying to reenter in mail account information, but it won't let me because the incoming mail server field is blank, but I can't enter anything into that field.

    No, didn't have to sign out. As I started to, got a messge saying something about losing all my calendar information, which unnerved me so I didn't sign out. It was correcting the password in another email account that corrected the situation for me.

  • 7.1 -- still refreshing calculated fields when loading?

    Hello.
    In 5.5 MDM would update calculated fields when loading a repository, which could lead to very long loading times in large repositories. Anyone knows if this was changed in 7.1?
    Alon

    Hi Alon
    Release notes for MDM 7.1 says Loading process for a repository has been optimized and reduced from earlier versions.
    But nowhere explicitly mentions the work done for calculated fields.
    hope this minimal info helps.
    best regards
    Ravi

  • HT204023 Hi, I'm Puthyrath. I have a problem on my iPad 4 wifi-3G about personal hotspot. I entered apn, username and password correctly, but when I leave this page, it didn't save, all fields become blank. Can anyone help me?

    Hi, I'm Puthyrath. I have a problem on my iPad 4 wifi-3G about personal hotspot. I entered apn, username and password correctly, but when I leave this page, it didn't save, all fields become blank. Can anyone help me?

    Update to above question:
    Hello All,
    To anyone with the same problem described above, on THEIR iPad (if it is running iOS 7.0.2):
    Go to Settings; Mail, Contacts, Calendars; DELETE your *******@btinternet.com e-mail account, that you originally set up either using 'Other', or the 'BT' option which I am sure was in the list previous to the iOS 7 update.
    Then ADD a NEW account choosing YAHOO from the list of options. DO NOT USE 'OTHER'.
    Enter the correct details just as you (almost certainly) had already done in your previous attempts using 'other'.
    When you see the 'verifying......' and 'the blue ticks' you should be able to exit settings and open your mail app and then receive all your 'old' e-mails again, AND be able to SEND as well.
    All my 'old' e-mails, were NOT found in the 'old e-mail' folder though. THEY are still in my inbox.
    So this fix worked for me.
    After I deleted my account from 'OTHER' and put it in Yahoo, I like other people also ended up with more folders.
    I hope this works for you on YOUR Apple devices.
    Bob

Maybe you are looking for