Show/hide fields based on T/F control - only showing or hiding, not both.

Hi Forum,

I'm looking to show/hide fields address based on a T/F control (or a single entry check box).

My online form has a number of business address fields, a T/F control and a number of postal address fields. I want the mailing address fields to hidden when a user clicks on the box 'As Above' (and demonstrated once again if they click this box once more).

I used the sample code (https://docs.oracle.com/cloud/latest/process_gs/CPRCW/GUID-F3BD3386-F333-45C6-AA56-C77136D169E5.htm) as a starting point for my Web form rule and it works as expected the first time that a user clicks area T/F (i.e. He's hiding the post fields) but it does not work the second time they until it clicks (where I assumed that fields would still be visible).

The T/F box has the following options:

true = as above

false = No

And my web rule looks like this:

If (AsAbove.value = true) {}

PostalAddress.visible = true;

PostalState.visible = true;

PostalPostCode.visible = true;

} else {}

PostalAddress.visible = false;

PostalState.visible = false;

PostalPostCode.visible = false;

}


I tried the same thing (with similar results) using a Checkbox control with a single option (according to the example code)

If (PostalAddressCheckbox [0] .value == 'As Above') {}

PostalAddress.visible = true;

PostalState.visible = true;

PostalPostCode.visible = true;

} else {}

PostalAddress.visible = false;

PostalState.visible = false;

PostalPostCode.visible = false;

}

As verified does not seem to be supported, is there another way to accomplish what I'm after, or I missed something somewhere simple (and y at - it documentation on the T/F control)?

See you soon,.

James.

Hello

Web Forms address these true-false as the boxes and, as such, in the form of tables.

You can see if you try to print the TrueFalse value. You should get something like java object lang @XXXXXX

Try to put the code as follows (in bold and underlined):

If (AsAbove[0].value = true """""") {}

PostalAddress.visible = true;

PostalState.visible = true;

PostalPostCode.visible = true;

} else {}

PostalAddress.visible = false;

PostalState.visible = false;

PostalPostCode.visible = false;

}

This should do the trick

See you soon

José

Tags: Cloud Computing

Similar Questions

  • Show or hide fields based on a variable value

    Hello

    I am a beginner in the field of Acrobat. And my only question is:

    How to shop around for a form field based on a value for the variable.

    For example, if x = 1, I want to circle Japan and if x = 0, I want to leave without any modification.

    Please help me. Thanks for your time and your help.

    Thank you

    Vijayvijay77.

    Circling something is going to be more difficult than simply to specify the value of a field. What kind of API for manipulating PDF that you use to change the PDF file?

    You might consider reviewing the document, if possible, you can use a checkbox or a radio button to indicate a selection, as opposed to circling a Word.

  • Show/hide fields based on the user's selection

    I know little of Javascript, but my first attempts to integrate it in Acrobat are bothersome. I have created a simple form where the user via a check box the number of people that he or she must register, then the form shows that several fields to complete. I tried to make it work with a single field, before I add more.

    In this example, I'm trying just to get the second hidden registered field if the user checks only 1 person to register. (I already know that I have issues when it comes to hide several fields).

    If (event.target.value == "0") {}

    this.getField("Registrant2").display = display.hide;

    }

    Given that I do not know what is the value of exports, try this:

    If (event.target.value! == 'Off') {}

    this.getField("Registrant2").display = display.hidden;

    }

    You can add an else clause so that the field is displayed when the check box is not selected:

    If (event.target.value! == 'Off') {}

    this.getField("Registrant2").display = display.hidden;

    } else {}

    this.getField("Registrant2").display = display.visible;

    }

    If this does ' t work, you don't maybe not the correct domain name. Verify that the console (Ctrl + J) to see all JavaScript errors are reported.

  • Show/hide fields based on the drop-down list

    Hello

    I'm trying to show/hide subforms with a drop-down list selection. I found a lot of information on the subject and ended up with what my script:

     form1.Page1.Division::exit - (JavaScript, client)
    
    switch (Page1.Division.rawValue)
    {
       case "1":
       SubformZZI.presence = "visible";
       SubformZZR.presence = "hidden";   
          break;
     
       case "2":
       SubformZZI.presence = "hidden";
       SubformZZR.presence = "visible";       
          break;
    }
    
    

    However, it does nothing when a selection is made in the drop-down list. I have the "SubformZZI" initially defined as 'Visible' and the 'SubformZZR', originally defined as "hidden".

    Any suggestions?

    Kind regards

    ZeroZone

    Check if the form is saved in dynamic form. File-> save as and choose dynamic for the type of shape...

    Other that that, you should check if you have given the values for the selection of the drop-down list as '1' and '2' in the tab of the control's binding.

    Thank you

    Srini

  • show/hide fields based on the drop-down list of choices

    I have a field from the drop-down list with three choices. Based on the selection, I need a specific text form field to appear and the others to stay hidden. (Or if it makes the code cleaner, the resulting field could be a drop-down list, too, with the selected choice.) I don't know Java well enough to extrapolate the code from the examples online and it fit my forms. I can provide an example of form. Thanks in advance for your help.

    There are ways to run this.  the easiest for you would be to add this script to the event (calculation of the Properties tab) to calculate the field that must be hidden.  Take notes, all "/ /" is some tips for you to understand the code.  You will need to put this script in all the areas you want to replicate the behavior, change the value depending on what you want to accomplish.  the word 'event' means myself to make you understand.

    If (this.getField("dropdown").value == 'put value here') {//replace "drop down" with the name of the drops}

    Event.Target.Display = display.visible;

    }

    else {}

    Event.Target.Display = display.hidden;

    }

    This works if you have a small amount of fields.  If you manage to have a large number of similar fields, let me know because there are other, faster ways.

  • Please help guys - hide fields based on the menu drop-down - javascript - output (adobe livecycle)

    I'm trying to hide certain fields in a form that is based on any value selected from a drop down menu, as shown in the image below. My main dropdown has values such as $25, $50 $ 75 and based on what value is selected, I want to hide two text field and date field, I created. Also when you select a value of $1000 I want to hide the ' field Manager ($ 25 - $ 100).

    hidefields.jpg

    That's how I would solve the problem. Note that the numbers used in the comparisons are links in the drop down menu.

    I don't know if it solves your problem exactly, but he should at least get you on the right track.

  • hide fields based on the value

    I have a script that I use to hide and show some areas according to what is entered in a certain area. The script looks like this:

    T1 var = this.getField ("text1");
    var t2 = this.getField ("text2");

    T1. Hidden = true;
    T2. Hidden = true;

    If (event.value > = "501")
    {
    event.willCommit = true;
    {
    T1. Hidden = false;
    }
    }
    If (event.value < = "500")
    {
    event.willCommit = true;
    {
    T2. Hidden = false;
    }
    }

    The problem I have is that he is seeking only the first 3 digits which is put on the ground. So, if I type in "3000", it reads like 300 and text1 appears instead of Text2. If I put in "6000", it shows the right field because it is read only 600. Is there another way I can write the script to make it work properly? Thank you in advance for your help!

    3 problems:

    1. the willCommit property is read-only. You can assign a value to it. You must remove these statements.

    2. you have inserted the numbers inside quotes, which turns them into channels and you cannot use them in mathematical comparisons. Remove the quotes and it should work.

    3. do not use the hidden property, it is not recommended. Use the display property.

  • Hide fields based on a LOV using javascript

    Hello

    I have a LOV that currently does a shipment and returns the fields corresponding to the selection. For example if the user selects the financing and funding type, fiscal year, funding type condition fields appear. Users don't like well how the page has charge for this. I was playing with some javascript, but it does not work properly.

    I put this in the field of Funding_type_c, under attributes of HTML form elements, but it does nothing.

    OnChange = javascript: "$f_Hide_On_Value_Item(this,'P2_DFCY_CATG_C',1)."

    I also changed my list of selection of category with him present a regular selection list.

    This does nothing more.

    funding_type_c has also a condition on the PL/SQL Expression: P2_DFCY_CATG_C = '1'

    Please notify.

    Thank you
    Mary

    Mary

    The 'if' statement is syntactically incorrect

    If oplan! = "Yes".
    must be
    If (oplan! = 'Yes')

    CITY

  • Hide/show the fields based on textbox

    I wonder if there is a way to hide certain fields based on the question of if a user enters a value in a text box and then reappear if the value in the text box is removed and the field becomes white.

    I have two scenarios where I would this happen

    1. I have a "Non-registered" check box and a text field 'blood pressure '. If the user check mark the box "Not registered", the field of blood pressure is hidden (I managed this already). If the user unclicks the box, the field of blood pressure again (even once, I did already). Otherwise, if the user enters a value in the 'pressure' I would 'Unregistered' area to disappear. I got this as well with this code: (placed in the form of javascript Action, mouse upward, event)

    this.getField("Not_Recorded").display = event.target.value = "Off"? Display.visible: display.hidden;

    I don't know if it's the appropriate script that I use, but he did not hide the field "unregistered". The problem is, I would 'not registered' to hide if a value is entered in the field of blood pressure and reappear if this value is then removed (i.e., the user changes his mind or made a mistake and wants to not click saved instead). I don't know if it's feasible or just way too complicated for me to do.

    2. in the second scenario, I have 2 text fields where the user must enter a value for weight in pounds or kilograms. There is a text box for a value of lbs and a text box for a value in kg. If the user enters a value for books, I'd like to field for kgs be hidden, but still, if they delete this value so that the lbs field becomes empty, I would field for kgs reappear.

    is this feasible or is there another way I might be able to do this?

    For the first, I would not hide the check box for the reason you give. In addition to hide the text field, it must reset it so that any value that the user may have entered is not retained when it is hidden.

    If you really want to show/hide the check box depending on whether there is an entry in the text field, you can use the validation script customized for the text field:

    var f is getField ("unregistered");.

    If (! event.value) {}

    f.Display = display.visible;

    } else {}

    f.Value = "Off";

    f.Display = display.hidden;

    }

    For this script start working, you change the value in the text field.

    For the second problem, what I do, is to have a single text field and two boxes to tick to indicate lbs or kg. If you want to stay with the configuration you have, you can clear the other text field with a custom validation script:

    Script for weight_lbs custom validate field

    If (event.value) getField("weight_kgs").value = "";

    Do the same for the other text field, but change the domain name in the script. This will allow only one field to be filled at the same time and do not bother with the masking.

  • Show or hide form fields based on Department

    Hello world

    I have a large form with many fields on. I have a requirement to show/hide some of these fields, based on the Department of the user code. So a user of a particular Department would see a set of fields over only those relevant to their Department - all non-relevant fields for this Department need to be obscured.

    My first thought was to define the conditional on each field and allows you to search if the field to be displayed by checking a department-field table in the SQL database. But it would mean a blow to the database for each field, that I need to check.

    Can anyone think of a more elegant (and efficient) solution for this? I use Apex 4.2.

    Hello

    Permission to create and assign to the patterns.

    Permission is normally performed only once per session.

    Kind regards

    Jari

  • I have problems with the radio buttons and prompting to show/hide fields.

    For example, the code below works but the for loop when entering 1 choice remains between the TI-57-119 mask fields all fields in my document. any help would be apreciated. choice 2 works fine.

    function updateFormField()

    {

    var v = this.getField("Group50").value;

    If (v == 'Choice1') {}

    for (var i = 57; 57 < = i < = 119; i ++);

    this.getField (this.getNthFieldName (i)) .display = display.hidden;

    }

    }

    else if (v == "Lendemain2")

    {

    this.getField("Text58").display = display.hidden;

    this.getField("Dropdown66").display = display.visible;

    this.getField("Text67").display = display.visible;

    }

    }

    updateFormField();

    There are chances that you can rename the fields so that they are more easily treated when you use a script? For example, if you have added a prefix such as "g1". (meaning group1) so that the domain names were like:

    G1.text57, g1.dropdown58, g1.text59, etc., the declaration if code could be simplified a little:

    If (v == 'Choice1') {}

    this.getField("g1").display = display.hidden;

    }

    } else if (v == "Lendemain2") {}

    this.getField ("g1. Text58") .display = display.hidden;

    this.getField ("g1. Dropdown66") .display = display.visible;

    this.getField ("g1. Text67") .display = display.visible;

    }

    This is called hierarchical domain naming, and it is easy to control large groups of fields. If you don't do it consistently name fields so that they are easier to reference in a loop, (e.g., text57, text58, text59,..., text110), then you will need to use a single statement for each field that you want to control, complicating the code and makes it more difficult to maintain.

  • OBIEE dynamically hide columns based on dahsboard guest

    Hi all

    I have a requirement where I have different fields the same as table report (Qty 0, Qty1...) Qty 20 and Desc 0, Desc1... 20 / / DESC and a few other fields of the same type). Now the user wants a selection option where it can enter a value to display a set of fields or multiple as in if it between '1', he expects to see only Qty1, desc1 and rest hidden report and this selection option must be multi select. I don't know if it's feasible. If Yes can you please help me.

    Thank you!!

    I don't think you achieve this using the column selecto as you try to replace several columns in one and Yes, you will need to create several reports and place them into different sections, then use conditional statements to show/hide the based on the value of the variables of the presentation. Not an ideal way to do but it could be acheivable.

  • You can hide fields when editing?

    I am trying to create an interactive piping Schematic of a customer. Rollover buttons using Acrobat to display the info has been incredibly helpful. I used simply form text fields or the picture. I'm sure that is not their intended use, but it serves my purposes.

    However, due to the size of the scheme, I had to overlap several of my fields and it became simply impassable.

    Q1.png

    Q2.png

    Is there a way to hide a part of the fields when editing so it will make it easier to place others? If not, is there some kind of option to overlay or script that I can use?

    I will eventually have to add images more than the latter. Acrobat is perhaps not the way forward. Otherwise, any other suggestions?

    Thanks in advance.

    No, you can't hide a part of fields while working on others, and no, you cannot set the order of the fields.

    It is good to use fields to display text and images, but you're pushing it a little. I suggest that you look into the use of layers instead. You can then show/hide layers by using the buttons and it will be much easier to work with. I hope that the application used to generate this file can do this. If not, then you better to import the file in Illustrator or Photoshop (depending on the type of image you have), add the layers and then export it to PDF and then set up the buttons.

  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • Hide fields

    Is there a way to hide fields in the jhs Application based on the following EL Expression definition: #{securityContext.userInRole ['roleList']}? The problem is that, if you do in pages, you need to update multiple and will be walking on it when you have the application regerate. Would be nice if you could push this check in the model.

    Of course, you can just type in this expression the form display, display in the Table or display in properties of Table Overflow.

    Steven Davelaar,
    Jheadstart team.

Maybe you are looking for