How do I fill and show/hide a series of text boxes based on checkboxes?

I have a series of checkboxes on a form (each of which requires some additional information to be entered) and a series of text boxes further down the page to house any necessary detailed information. 
I have hidden the detail fields and coded the form so that for each of these checkboxes that is checked a row of detail text boxes appears with the checkbox title in the activiy type field, and if a checkbox is subsequently un-checked the last row of detail text boxes is hidden. 
The problem with this is that if the user unchecks any box other than the most recently checked one the data for the option they just unchecked still shows, but the data for the last option they selected does not. 
Does anyone have a solution that would make sure the detail fields for the boxes that are checked is displayed in the detail text boxes that are showing when a checkbox is unchecked, regardless of the order in which the boxes are checked/unchecked?
This is what my form looks like, with the example where Cash Withdrawals is unchecked but appears in the detail and Remote Deposit Capture is checked but was hidden with the last line:
The detail groups are named Act1.child, Act2.child, etc. where the description field (filled in the example above) is Act1.type, Act2.type, etc.
Here is the script I'm using on the checkboxes to achieve what I'm getting now:
var useSet = this.getField("Set").value;
var clrSet = this.getField("Clr").value;
var useType = useSet + ".type";
var clrType = clrSet + ".type";
if (this.getField("CheckboxName").value != "Off") {
    this.getField(useType).value = "Check Box Desription";
    this.getField(useSet).display = display.visible;
else if (this.getField("CheckboxName").value == "Off") {
    this.getField(clrType).value = "";
    this.getField(clrSet).display = display.hidden;
and here is the script for the hidden boxes that determine what sets are filled and what sets are cleared and hidden:
Custom Calculation Script for "Set":
var sOne = this.getField("Act1.type").value.length;
var sTwo = this.getField("Act2.type").value.length;
var sThr = this.getField("Act3.type").value.length;
var sFour = this.getField("Act4.type").value.length;
var sFive = this.getField("Act5.type").value.length;
var sSix = this.getField("Act6.type").value.length;
var sSev = this.getField("Act7.type").value.length;
if (sOne == 0) {event.value = "Act1"}
else if (sTwo == 0) {event.value = "Act2"}
else if (sThr == 0) {event.value = "Act3"}
else if (sFour == 0) {event.value = "Act4"}
else if (sFive == 0) {event.value = "Act5"}
else if (sSix == 0) {event.value = "Act6"}
else {event.value = "Act7"}
Custom Calculation Value for "Clr":
var cOne = this.getField("Act1.type").value.length;
var cTwo = this.getField("Act2.type").value.length;
var cThr = this.getField("Act3.type").value.length;
var cFour = this.getField("Act4.type").value.length;
var cFive = this.getField("Act5.type").value.length;
var cSix = this.getField("Act6.type").value.length;
var cSev = this.getField("Act7.type").value.length;
if (cSev != 0) {event.value = "Act7"}
else if (cSix != 0) {event.value = "Act6"}
else if (cFive != 0) {event.value = "Act5"}
else if (cFour != 0) {event.value = "Act4"}
else if (cThr != 0) {event.value = "Act3"}
else if (cTwo != 0) {event.value = "Act2"}
else {event.value = "Act1"}

Hi Andi,
Please consider the following “solution” too.
Preliminaries
An indicator can be considered a variable in JavaScript.
If P is an indicator, m(P) refers to the value of the indicator.
Data for Control
There are four checkboxes: C0, C1, C2 and C3.
There is an indicator for each checkbox: CP0, CP1, CP2 and CP3.
If checkbox Ci is checked then checkbox indicator CPi has the value i+1; in other words, m(CPn) = i+1. If checkbox Ci is not checked then checkbox indicator CPi has the value 0; in other words, m(CPn) = 0.
There are four sets of detail fields: A0, A1, A2 and A3.
There is a detail fields indicator for each detail fields: AP0, AP1, AP2 and AP3. If detail fields Ak have the details for the checked checkbox Ci then APk has the value i+1; in other words, m(APk) = i+1. If detail fields Ak do not have any details for any of the checked or unchecked checkbox then APk has the value 0; in other words, m(APk) = 0.
The sets of detail fields are organized in sequence. The “top” or “first” set is AP0. It is followed by AP1. Then followed by AP2. The “bottom” or “last” set is AP3.
Consider an example with one checkbox selected. In this case m(CP2) = 3; m(AP0) = 3; m(CPi) = 0 for i=0, 1, 3; and m(APk) = 0 for k=0, 1, 3. See the following diagram too (see Figure 1).
Events, Processes and Additional Data for Control
Computation begins when a user event is captured by the system (such as a mouse up event in an AcroForm field like a button or a checkbox).
Checking Process
If a checkbox is checked (TNj), it is noted with an indicator (P0).
Shift Process
Given a noted checkbox, the search for a candidate set of detail fields to use for the noted checkbox begins.
The first candidate is the bottom of the sequence. This is also the current candidate, k. Thus k=3.
The current candidate is remembered by marking (TSk,j) the detail fields indicator (APk).
If k=0 then the shift process ends and the current candidate is the candidate.
If k > 0 and m(APk-1) = 0, the current candidate becomes APk-1 and step 8c is repeated.
If k > 0 and m(APk-1) != 0, then the shift process ends and the current candidate is the candidate.
Unchecking Process
If m(CPi) != 0 and m(CPi) = m(APk), then the checkbox can be unchecked (TRk,i).
Shift Process
If m(APk)=0 and m(APk+1) > 0 then shift (TSk,m(APk+1)). At the end of this shift, m(APk) > 0 and m(APk+1) = 0. Let k = k + 1.
If m(APk+1)>0 then repeat 9a. If m(APk+1)=0 then the shifting process ends.
Last Events and Proceses
Details fields can be initialized (TIk,j) and displayed (TDk,j) or cleared (TCk,j) and hidden (THk,j). These actions depend only on m(APk). However it would be a good idea to trigger these functions right after a shift process ends and on affected details fields.
Process Diagram of One Checked Checkbox
Figure 1 is a process model of the checkbox process with one checked checkbox.
Figure 1 Checkbox Process Model
Regards,
John

Similar Messages

  • How can I fill in a default inputText in a Text Box

    How can I fill in a default inputText in a Text Box. Is it possible to create a button and then it should be possible some underlying data fill in the text boxes???
    Please help!

    My coding looks at the moment like that:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ page language="java" %>
    <html>
    <head>
    <title>
    JSF
    </title>
    </head>
    <body>
    <f:view>
    <h:form id="user">
    JSF Application View:<br><br><br>
    Credit Limit:.......
    <h:inputText value="#{User.username}"/><br>
    Currency:...........
    <h:inputText value="#{User.username}"/><br>
    Score:..............
    <h:inputText value="#{User.username}"/><br>
    Valid Date To:......
    <h:inputText value="#{User.username}"/><br><br>
    <h:commandButton value="Receive Data from Background" action="success" /><br>
    </h:form>
    </f:view>
    </body>
    </html>
    Now my question is how it is possible to fill in the inputTextvalue when I click on the Button "Receive Data from Background" Is it possible to define that in that coding above????
    Please help I'm not fit in JSF

  • How do I recognize and treat seperately entries in a text box?

    I've placed a text box in a report that is populated by data entries that are seperated by a semicolon.  Each entry is unique and distinct.  I want to try to count and group these individually, but since they exist in a text box seperated by a semicolon, how can I treat them as unique?  Here is an example: 
    02 Inadequate Policies and/or Procedures;01 Lack of Policies and/or Procedures;05 Inadequate Separation of Duties;10 Financial Systems Deficiency;

    Hi,
    Whether the values is fixed ie, you will get a string with 5 values which is :;: seperated.
    If it is fixed you can use a way.
    for ex; you have a string of 5 values.
    first formula u write : Stringvar
    Variablename := split(Fieldname,';')[0]
    like that five formula.
    Then you can take the count(Variablename).
    Regards,
    Sathish

  • How to Handle and show multiple pushpin imgaes on the map based on the requirement at different coordintes?

    How to Handle and show multiple pushpin imgaes on the map based on the requirement at different coordintes?
    I have multiple images in  my App folder. I want to use and show those images dynamically  in windows phone 8 map application

    There are a lot of different ways to do this. One simple method is to use a switch statement when creating your pushpins and based on some property in your data, select the icon you want to use and create your pushpin accordingly.
    http://rbrundritt.wordpress.com

  • How do you change the font color in CALL-OUT text boxes in PRO XI?

    How do you change the font color in CALL-OUT text boxes in PRO XI?

    It's not so simple to find it if you don't know what you're looking for... But it can be found via View - Show/Hide - Toolbar Items - Properties Bar.

  • I am pulling my hair out! I am using adobe indesign and just want to make a text box 'autofit text' as I change fonts a lot and want the font to automatically re-size as I change it. help help help please - I have latest version of indesign - thanks

    I am pulling my hair out! I am using adobe indesign and just want to make a text box 'autofit text' as I change fonts a lot and want the font to automatically re-size as I change it.
    Is it not possible to create a text box, fill it with dynamic (data driven) text, but make the font size either scale up or down automatically, so that the entire text box is filled? This is a feature in PrintShop Mail Pro called COPY FIT. but no such feature in Indesign??
    help help help please - I have latest version of indesign - thanks, DJ

    lol... it seems to work, but I have another huge problem!
    Apparently .CSV files cannot contain page breaks in the data! The data I am trying to merge is a 'letter', with paragraphs, line breaks, etc.,
    But, after data merging, it ignores page breaks and only merges the first paragraph of each letter. (sigh)
    Solution? Hopefully, an EASY solution. lol as we have thousands of records.
    Is there a third party indesign plugin that will allow .xml, or .xls data merge import??
    Thx,
    DJ

  • Problem in Showing multiple values into one text box.

    Hi all,
    How can show i multiple row values into one text box. here text box is multi line type.
    i have one table it has content column, it has number of rows. i need to show those data into one text box in form. how can i solve it?
    my sample code here,
    egin
    --:block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    -- go_item('txt_from');
    insert into chat(fromid,toid,content)values(:block3.fromid,:block3.toid,:block3.txt_From);
    :block3.txt_From:= null;
    commit;
    :block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    go_item('txt_from');
    declare
    cursor c4 is select content from chat where toid = :block3.fromid;
    rec1 c4%rowtype;
    begin
    open c4;
    loop
    fetch c4 into rec1;
    exit when c4%notfound;
    null;
    end loop;
    end;
    --select content into :block3.txt_to from chat where toid= :block3.fromid;
    end;
    please give me some tips to solve it.
    thanks
    gurus

    Hi,
    Try giving CHR(10) for line feed.
    DECLARE
         CURSOR C4 IS SELECT CONTENT FROM CHAT WHERE TOID = :BLOCK3.FROMID;
         Str_Temp VARCHAR2(20);
    BEGIN
         :BLOCK3.TXT_TO := '';
         OPEN C4;
         LOOP
              FETCH C4 INTO Str_Temp;
              EXIT WHEN C4%NOTFOUND;
              :BLOCK3.TXT_TO := :BLOCK3.TXT_TO || CHR(10) || Str_Temp;
         END LOOP;
         CLOSE C4;
    END;Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • How do i change the number of columns within a text box?  I need to go from three columns to one.

    How do I change the number of columns within a text box?  I need to go from 3 columns to 1.  The insert column is highlighted and column break does not work for this.

    Pages '09 does not seem to allow layout breaks in Textboxes.
    Pages 5.2 has the same limitation.
    Use multiple linked Textboxes in Pages '09 to get the layout you want or create your layout in a Word Processing template in the document layer.
    Peter

  • ADF 11g + How to capture the value of a dynamically created input text box

    Hi All,
    I have a requirement where, on selection of the value in a drop down, the input text boxes need to get dynamically populated on the JSPX page. I'm able to bring this functionality, and it is working fine.
    But the challenge right now I'm facing is that, how to read/capture the value entered in those dynamic text boxes on submission of the page. Please help me in getting this resolved.
    Below is the code snippet I'm using for this.
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    RichInputText pcPreferredDomain = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks All in Advance,
    Thanks & Regards,
    Dharmathej M

    As per your method, you are creating the RichInputText components as local variables.
    What happens when you are creating them as class level variables in the managed bean, if you do so, you can refer to the values of the UI components in the actionListener/action code for the command button in the managed bean
    sample:
    public class ManagedBean{
    RichInputText [] pcPreferredDomain;
    public ManagedBean(){
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    pcPreferredDomain = new RichInputText[iIPAddress];
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    pcPreferredDomain[i] = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks,
    Navaneeth

  • How to use a radio button in enabling/disabling a text box in report progra

    Hi,
        Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.

    *& Report  ZMR_RADIO_BUTTONS
    REPORT  ZMR_RADIO_BUTTONS.
    PARAMETERS : R1  RADIOBUTTON GROUP G1,
                 R2  RADIOBUTTON GROUP G1.
    PARAMETERS : A1 TYPE I,
                 A2 TYPE I.
    AT SELECTION-SCREEN OUTPUT.
    *initialization.
    IF R1 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF R2 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    modify screen.
    ENDLOOP.
    ENDIF.
    START-OF-SELECTION.
    *IF R1 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 1.
    ENDIF.
    *ENDLOOP.
    *ENDIF.
    *IF R2 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 0.
    ENDIF.
    *ENDLOOP.
    *ENDIF.

  • Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the sam

    Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the same system, os 10.8.3, cs6 and UTC4. And of course we`re using exactly the same font....

    Packpool,
    I believe the first thing to do is to update to 16.0.5.
    Adobe - Illustrator : For Macintosh

  • How to script text field based on checkbox selection

    I've written a script to format specific text boxes based on what checkbox is chosen. However, I'm not sure what I need to script in order to CLEAR the text field once the checkbox is unchecked. As it stands now if the checkbox is selected it formats the text field with the necessary information, but if it's unchecked the information stays in the box. I'd like to be something like 'if all boxes are Off then display 0.00.' I've included the current script for reference
    var one = this.getField("Emp 500");
    var two = this.getField ("Emp+C500");
    var three = this.getField("Emp+S500");
    var four = this.getField("Fam500");
    var five = this.getField("NC500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='70.70'}        
    else if (two.value ==
    'Yes') {six.value='127.20'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='198.00'}
    else if (five.value == 'Yes') {six.value='0'}
    var one = this.getField("Emp 1500");
    var two = this.getField ("Emp+C1500");
    var three = this.getField("Emp+S1500");
    var four = this.getField("Fam1500");
    var five = this.getField("NC1500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='61.47'}
    else if (two.value == 'Yes') {six.value='110.49'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='123.04'}
    else if (five.value == 'Yes') {six.value='0.00'}

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?
    Create two dynamic action
    1. Make it order number item disable on page load.
       Event : Page Load
       Action : Disable
       Fire When event result is : True
       Selection Type : Item
       Item : Your order number item
    2 . enable and disable order number on selection of order type(assuming when order type is null it is disable otherwise it is enable)
        Event : Change
        Selection type : item
        Item : your order type item
        condition : is not null
    True Action
        Action : Enable
        Fire When event result is : True
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    False Action
        Action : Disable
        Fire When event result is : False
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    Hope this helps you,
    Regards,
    Jitendra

  • Help with radio buttons and show/hide javascript

    Hi. I'm new working with LiveCycle and also pretty much at a basic/beginner level of javascripting. I'm creating a pdf fillable form and one of the tasks I've been given is to add a function where if Option A is chosen by the user, then the correspondng table will appear, and if Option B is chosen another table will appear. After some searching I Iearned more about how radio buttons can be used, so I created a set of radio buttons. I have tried several different things, the latest was making both tables "hidden", and then taking to the radio button list group and applying the show/hide script to each of the radio buttons in the group. Still nothing seems to be working as I want it to. The table remains hidden when I click on the . This is what the code looks like right now. I know I'm obviously doing something wrong, this seems like such a basic thing to code. Getting to the frustration point, if you can sort me out with what I am missing/overlooking please let me know. Many thanks!
    Note. The radio buttons are not in the same table, they are higher up in the form outside of the tables that I am trying to show/hide, but they are in the same subform. I don't know if that might be an issue?
    form1.#subform[0].RadioButtonList::click - (JavaScript, client)
    form1.#subform[0].RadioButtonList.#field[0]::click - (JavaScript, client)
       if ( RadioButtonList.#field[0].selectedIndex == 1)
         form1.#subform[0].Table1_Work.presence = "visible"
       else
       form1.#subform[0].Table1_Work.presence = "hidden"
    form1.#subform[0].RadioButtonList.#field[1]::click - (JavaScript, client)
       if ( RadioButtonList.#field[1].selectedIndex == 2)
        form1.#subform[0].Table1_Official.presence = "visible"
      else
         form1.#subform[0].Table1_Official.presence = "hidden"

    Hi,
    For starters you have unnamed pages, which is not a good idea. This makes it more difficult to reference objects. In your JavaScript you would have to resolve the node, however the simpliest route would be to name the page first. Something like "page1". Have a look at this example for referencing objects: http://assure.ly/kUP02y.
    Next I would not place the script in each of the radio buttons, as this is likely to cause conflicts and is doubling the script. The best place to put the script is in the click event of the radio button exclusion group. This contains all of the radio buttons. See an example here: http://assure.ly/h7whb8 and https://acrobat.com/#d=ALebgueDXjewHjGyYRdrmw.
    You syntax for JavaScript if/else statements is potentially incorrect. The script within the statements should be wrapped in curly brackets. While you can get away with it for single lines, I would not be inclined to take that approach. So:
    if (a test) {
         // do something
    else {
         // do something else
    With the radio button exclusion group you can use its rawValue, just specify it in the Object > Binding palette. So on the basis of chaning the page name:
    if (this.rawValue == "1") {
         page1.Table1_Work.presence = "visible";
    else {
         page1.Table1_Work.presence = "hidden";
    There is a syntax checker button in the Script Editor that should highlight errors.
    Niall

  • How to get property and show itself in the Operator interface

    Hello, I suppose it's simple but I don't know to do.
    With Labview opertor interface, I would like to get a property of a step, for example the serial number or a local variable, and show its value in an labview indicator. Only that.
    Thanks.

    Hi,
    You can use UIMessages. See http://zone.ni.com/devzone/cda/tut/p/id/4532
    Example show you how to for TS 3.0 or greater
    Regards
    Tom Andres Lomsdalen, CTD

  • How to upload file and show it's progress

    hi
    i want to upload files and show the progress of the upload
    process how?
    thanks in advance.

    Hey,
    I attached a sample I did in Flash 8 using PHP. Hope it
    helps.
    http://www.cybercussion.com/vault/fileuploading.zip

Maybe you are looking for