validation on three form fields with a report

Hello ~
I have a text field (p53_fiscal_yr), two select lists, (p53_month) and (p53_calendar_yr). You should only be able to either put a value in to p53_fiscal_yr OR select a value for p53_month and p53_calendar_yr. By setting a value for p53_fiscal_yr only, my validation error is displayed when it should not.

For example:

p53_fiscal_yr = 1998
p53_month = None
p53_calendar_yr = None

Error: you must select either a year or a calendar month and year.



My validation code: function returning Boolean

IF (: p53_calendar_yr = 'None') and (: p53_fiscal_yr! = 'None') OR (: p53_fiscal_yr = 'None') and (: p53_calendar_yr! = 'None') THEN
RETURN TRUE;
ON THE OTHER
RETURN FALSE;
END IF;

Can anyone help? Thank you
Deanna

Hi Deanna,

Your logic is a bit wrong!

IF (:p53_calendar_yr = 'None') and (:p53_fiscal_yr != 'None')OR (:p53_fiscal_yr = 'None') and (:p53_calendar_yr != 'None')THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;

This is equivalent to A AND B or B AND A. This could be interpreted as A AND B, or B AND A, which, in view of testing, means A = 'None' AND (B = 'None' B or! = 'None') AND A! = "None" - which boils down to A is None AND is NOT nothing, that can happen!

Try to change this:

IF ((:p53_calendar_yr = 'None') and (:p53_fiscal_yr != 'None')) OR ((:p53_fiscal_yr = 'None') and (:p53_calendar_yr != 'None')) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;

Andy

Tags: Database

Similar Questions

  • Is it possible to define the validation on a form field with data from another field in Adobe Acrobat?

    Thanks in advance for any help and advice. I am defining a validation for a field that ensured that the amount entered is 25% from another domain. I tried implementing a validation, but were unsuccessful. Can anyone offer any idea or solution? Thank you!

    You will need to use a script to do it. Something like this should do it:

    If {(event.value)

    Event.RC = true;

    var v1 = + this.getField ("NameOfOtherField") .value;

    If (event.value +! =(v1*0.25)) {}

    App.Alert ("the value entered must be 25% of the value of NameOfOtherField.");

    Event.RC = false;

    }

    }

    (This will check if the value is exactly 25% of the value of other... If you meant something else, please specify)

  • Form field with comma delimited list of values to cfc

    I have a form that moves from a field to a page of the action with a value of delimited by commas.

    For example, the domain name is: Program_ID

    value of program_ID is: 31, 32

    I am able to deal with this variable in a list and check its length and loop over the list before passing to a cfc using the attached code:

    When I try and pass the variable as a string of a cfc and call a query, see no longer recognizes my var in list form.

    This is why the related code does not work...

    Is there a type specific var that cross as a list and allows me to execute the block of code attached?

    Thank you

    Craig

    OK, answered my own question... Here is the answer for those who are interested...

    initialize the var for CFCs in the cfinvoke statement

    Pass the argument to cfc string

    Use listqualify to parse the list of CFCs and to define new var

    Use the new var in the following statement in the sql code:
    ((Program_ID) TO (#PreserveSingleQuotes (selectedProgramID) #))

    The following code runs a form field with a single value or a value of delimited by commas.

  • How can I update form field with data using "on Blur.


    Perhaps also very easy for all the experts out there that you but I'm trying to update a form field with data in another field in the form when they come out the first form field.

    Basically creating a "billing" and a form "shipping" I want to be updated automatically.

    Any help would be extremely Grateful.

    Thank you

    Steve

    He does!

    shipFirstNameText.value = this.value

    It worked

  • How can I change the pdf file cannot be modified, but hold down the scroll button for the form fields with multiple lines?

    I need all the information to display so I need the scroll key to work, but it is not editable.

    Thanks for the help!

    Tania

    You can define a field with strike and validate to prevent the user from changing the value of the field. First, set the field to multiline and 'Scroll long text' and the default value for the text to display in the field. Then add a custom script to strike which is:

    Custom keystroke script

    Event.RC = false;

    and to be complete, the validation script customized according to:

    Custom validation script

    If (event.value! == event.target.defaultValue) event.rc = false;

    These scripts will prevent the value to be changed, at least in Acrobat and Reader if JavaScript is enabled.

  • How to make a form field with Adobe Muse?

    Hello

    I hope you can help me guys, im trying to do a one page Web form field (this form is just to get a phone number, as the registration forms have a similar field) and the problem is with the widgets I can´t clear the field name and email... Is it possible to eliminate those?

    Thanks a lot for your help

    Hello

    I fear that it is not possible to do the same, in the field name and email are required.

  • Update database with several form fields with the same name

    If I've made good progress on my CF photo album project, but now I meet a problem.  Once I downloaded a collection of photos and them inserted in my database, I bring up a page that is actually an array containing the thumbnail of each image, some info on it and the description of the photo.

    The table is inside a < form > tag, and the description is a < textarea > tag.  I have many text boxes that I have pictures, so there may be any number (within reasonable limits).  I'd like to be able to type a description for each picture in each text box rather than having to do one at a time, and then click the button submit to update my file.

    Each text box has the same name, so I had the idea of adding a hidden form field that held the photo ID, then on the processing page, I might have a < cfloop >.  My problem is that I can not understand how to associate each photo with the corresponding description ID, especially if we consider that some of the descriptions may be empty.

    Is there a good way to do this?

    As you probably understand, giving all your textareas eponymous means that when the form is submitted, you get a value that is a list of the contents of each text box comma-delimited.  If none of the commas are typed in the text box, you have a problem.

    My preferred method is to include some sort of identifier as part of the name of the form field.  Since you have ID photo available, I would use those.  This would give your names textareas as description_111, description_112, etc.

    When the form is submitted, I loop through the form.fieldnames list.  If the first 12 characters are 'description_111', I can remore 12 characters to get the id.  I also have the content of the text box using the array notation.

  • Replace the text in the form field with javascript

    Hello

    I am trying to replace an existing text in a form field, if a user enters a number.  For example, during the validation of required fields, Adobe does not accept "0" as a valid entry.  My users regularly enter '0', and it must be valid.  I noticed that if you enter "0.001 ', he admits that, but still the poster ' 0.00' (I'm only show 2 decimal places, so it's OK)."

    My problem is that I can not find the syntax to have the ' 0.00' replaced by a "0.001' by the system."

    I would be very happy for any input!

    Thank you!

    Try the following script:

    var requiredFields = [], error = "";
    
    for (var i = 0; i < numFields; i++) {
    
        var fName = getNthFieldName(i);
        var f = getField(fName);
    
        if (f.type !== "button" && f.required && !f.valueAsString) {
            requiredFields.push(fName);
            error += fName + "\r";
        }
    }
    
    if (error) {
        app.alert("Please complete the following fields: \r\r" + error, 3);
        getField(requiredFields[0]).setFocus();
    } else {
        print();
    }
    

    Edit: correction of stuff

  • How to fill a hidden form field with a value passed in another page

    I use PHP/MySQL and DW CS4.

    I'm trying to get the foreign key to a table and include it in a hidden field in a form to another table.

    The user selects a 'need' to a list and is taken to a new page that displays the need selected in the previous page and a form that the user can fill out with details of its offer, there is also a hidden field in the form that contains the index to the table needs, this hidden field retains the external key. Most of the code works, except to fill the hidden field with the external key. I proved (by printing it on the screen) that I got the external key and stored in a variable ($saveNeedId). I am unable to do so, what affect this variable in the hidden field in the form, I'm about to be stored in a table. Sometimes, I have zero and sometimes I get the index of the first necessity in the table. It should be simple but I can't make it work, I must be missing something obvious - still very new to PHP.

    The following code sets the variable and display for test purposes

    $saveNeedId = "-1";
    If (isset($_GET['needId'])) {}
    $saveNeedId = $_GET ['needId"];
    print $saveNeedId;
    }

    Here is the code that implements the fields hidden in the form, where I'm putting in place is the first one, needId

    < input type = "hidden" name = "needId" value = "<?" PHP echo $row_rsNeedsUnmet ["needId'];? ">" / >
    < input type = "hidden" name = "offerId" value = "" / > "
    < input type = "hidden" name = "MM_insert" value = "form1" / >

    The page where the user sees the list of needs is here www.hollisterairshow.com/weneed.php

    I would really appreciate sone help with this, I tried all combinations of double quote, percent sign and nothing works... sigh.

    Tony

    The following code sets the variable and display for test purposes

    $saveNeedId = "-1";
    If (isset($_GET['needId'])) {}
    $saveNeedId = $_GET ['needId"];
    print $saveNeedId;
    }

    Here is the code that implements the fields hidden in the form, where I'm putting in place is the first one, needId


        
        

    I looked at your page. It seems that you have thought about it.

  • You want to varify each form field with the value from database?

    Hello Experts,

    I have to implement a feature that will confirm the change for each text field on the form.

    Scenario:

    I have a form with several fields of database tables.

    We have set the indicator for each column of each table to Yes or no in a master table to access.

    When users navigate to any text field in any database block, procedure, or a function will varify that access is granted for the amendment of this column.

    If the access flag is set to yes, user can change. otherewise fast with the message, you are nor allow to change this field.

    I don't want to call this procedure and a function in each field.

    Also, if in the future if a new field will add to this form, there is no need to change in the code or we should not require to remember to check the indicator of access to this column.

    Please help me.

    Thank you

    Yoann

    NEXT-KEY is always triggered, then you can try to put that code in WHEN-VALIDATE-ITEM trigger. This way you can navigate on this field if it's empty DB, but can not force the user to enter data in a new record. Alternatively, you can ask again priviledge change data in your trigger KNI.

  • determine the sequence of form fields with barcode

    Hello

    In the part of the form with barcode design, we will extract data using the scanner at hand for excel file or notepad.

    Can we determine the sequence of fields of data (output) in the form designer?

    Need your kind advise for that matter

    Thank you

    Raja

    Raja,

    Here is a simple example of a custom bar codes for a PaperFormsBarcode encoding using a pipe delimiter.

    The "Barcode encoding text" field contains the value of the PaperFormsBarcode object. It is a useful debugging technique.

    The event on the PaperFormsBarcode object calculate done encoding.

    Form1.Page1.Subform1.barcode::calculate - (JavaScript, client)

    If (xfa.host.version< 7.05)="">

    this.rawValue = "";

    }

    else {}

    this.rawValue = encodeBarcode();

    }

    function encodeBarcode() {}

    define variables of barcode

    var firstName;

    var name;

    var Address1;

    var address2;

    City of the var;

    var State;

    var zip code;

    check for null name

    If {(form1.page1.subform1.firstName.isNull)

    firstName = "";

    }

    else {}

    firstName = form1.page1.subform1.firstName.rawValue;

    }

    Check for null name

    If {(form1.page1.subform1.lastName.isNull)

    lastName = "";

    }

    else {}

    lastName = form1.page1.subform1.lastName.rawValue;

    }

    Check the null address

    If {(form1.page1.subform1.address1.isNull)

    Address1 = "";

    }

    else {}

    Address1 = form1.page1.subform1.address1.rawValue;

    }

    Check the null address

    If {(form1.page1.subform1.address2.isNull)

    address2 = "";

    }

    else {}

    address2 = form1.page1.subform1.address2.rawValue;

    }

    check out the city for null

    If {(form1.page1.subform1.city.isNull)

    City = "";

    }

    else {}

    City = form1.page1.subform1.city.rawValue;

    }

    check the status for a selection zero

    If {(form1.page1.subform1.state.isNull)

    State = ' ';

    }

    else {}

    State = form1.page1.subform1.state.rawValue;

    }

    check the ZIP Code for null

    If {(form1.page1.subform1.zipCode.isNull)

    Postal code = "";

    }

    else {}

    Postal code = form1.page1.subform1.zipCode.rawValue;

    }

    build the barcode for the encoding string

    var str = firstName + ' | '.

    + Name + "" | ""

    + address1 + "" | ""

    + address2 + "" | ""

    + City + "" | ""

    + State + ' | '.

    + Postal code;

    Returns the string encoding

    return (str);

    }

    Steve

  • Text form field properties: access with Javascript?

    Hello

    I wonder if it is possible to access all of the properties of text form field with Javascript.

    The basic game is available under the domain object, but I'm looking for the other stuff that does not specifically exist for the fields of rich text, such as the properties of next paragraph:

    Dashes (left and right, withdrawal, first to the first line indent), the vertical alignment (top, bottom, middle), space above and below and attack (line spacing).

    All this is available if you place your cursor in a rich text field and press Ctrl-E to open text form field properties, then click on "More".

    So I wonder if it is also accessible via JS, because I can't find anything in the documentation on the subject.

    Thanks much for any help!

    Ariel

    Some properties of rich text are available, but not those you mentioned.

    I'm afraid.

    Study of the Span object to find out which ones are.

  • A web site can generate PDFS filled by downloading a PDF file with empty form fields?

    In other words, if I provide my web developer with a standard form PDF file that is ready to be filled, can code the site to "fill" the form fields with the data generated by a release of the database?

    Here's the goal: I need to have nice aesthetically "certificates" generated by the web site for the print client. The design is approved, but the customer does not want to have to fill them all individually. We have the data, and I'd love to be able to 'plug in' on individual PDF files. The question is, can 'take' the data that a user in Acrobat Pro/Reader/DC of PDF software? A web site "tool" can be coded to fill the fields of the PDF format and save a printable file?

    Keep in mind, I'm a designer, so I probably don't have a response technical, more just one "Yes, you can do this using the...» "or a 'of course not, silly designer guy, it would be a huge security risk' or whatever, so that I can know whether or not to have my web devs continue this as a solution.

    Yes, it is possible, but not with Acrobat, which cannot be used on a server.

    There are other tools that can do it, even if the side server.

  • Domain name is already used elsewhere in this Document, eSign model error of form field

    I * want * the field having the same name, because I want the value to flow to this second field.  Although this seems to be no problem to do with a document created in Acrobat and downloaded, I can't create the model of form field with the same name.  I need the model because the underlying doc is often twisted.  Very frustrating.  Anyone encountered this or have alternatives?

    I ran across this in EchoSign when the deletion of the field then trying to re-create and reuse the old name. For some reason any after deletion of the original field, I can still find it in the list "go to...". ». My work around was to give it a temporary name, save and exit. Go to manage and change. It is usually passed in the jump list and I can use the old name. HTH

  • Enter the text for the form field and do to repeat in the following pages

    Hi - I'm working on an interactive form of 14 pages. There are two text fields that must appear on the bottom of each page.

    Anyone know if it is possible for the user to these fields in competition once and while the text automatically repeat on the following pages?

    I create the form in InDesign CS6 (I CC, but it runs like a turtle).

    Any help much appreciated! Thank you.

    Form fields with the same name will have the same value, so just name them

    Similarly.

    Duplicate a field on several pages is easily achievable in Acrobat, by the way.

    There is a built-in function that allows you to do when you right click on a shape

    in form editing mode.

Maybe you are looking for

  • What happened to save a bookmark in an existing folder? Now, I have to save and then change the bookmarks - huge time waster

    I'm sorry if I'm simply not see something obvious, but save and organize bookmarks appear to have taken a huge step backward. It seems I can save only a bookmark in the zone unsorted bookmarks and then need to open the bookmarks library to move the b

  • 'Add to list' button to WoWHead (Javascript function) does not?

    Hey guys, hope everyone is having a great Friday. I encounter a situation with the WoWHead website, which is a Blizzard-World of Warcraft fansite. They have a button called, add to the list, which allows the user to add a piece of equipment, weapons,

  • Fashplayer DOWNLOAD corrupted my computer

    I was prompted to install the update of Flash Player and wsn can't pay attention, just by clicking on "next". Now, I have all kinds of new things like "whitesmoke" in my firefox browser and all kinds of ads followed playing and other fragmentary soft

  • El Capitan &amp; Safari

    is one of the problems with Safari after loading the most recent OS El Capitan? I have an iMac with a 2.8 GHz processor and I was not able to load a lot of old sites I've done the upgrade. I have SAFARI can't find the site.  All my other devices work

  • Qosmio G30 - 126 - odd scraping noise

    Hello! I have a Qosmio G30-126 and OS Vista Ultimate. A month ago, my laptop was taken in service because it wouldn't turn on, but since last week, when I started it was a scraping extended noise at startup and since then, whenever I m listening to m