show/hide fields with percentages

I'm trying to find a script to show/hide a field as a percentage that is located in one of the fields. The script that I usually use to base numbers is:

var r1 = this.getField ("V1");
var r2 = this.getField ("V2");

R1. Hidden = true;
R2. Hidden = true;

If (event.value < = "100")
{
event.willCommit = true;
{

R1. Hidden = false;
}
}

If (event.value > = "101")

{

event.willCommit = true;

{

R2. Hidden = false;

}

}

So I need basically the same thing again but I need to be field appears if "38.00%" or above is entered. If anything lower then it is entered, I need 2 field is displayed... I can't make it work once the decimals are here.

Thank you in advance for your help!

The percentage format is just for display and rounds the value of the current field, the value of the actual field is the decimal number created by the division or entered by the user.

100% is entered as 1.00 but if the result of a calculation, it could be 99, 5 - 1.4. If you want to compare the calculated value, you may need to round the value of the fields for the same number of decimal places that display area. You should be aware that using the Math.round of JavaScript method may cause an error with numbers rounding floating-point. You can use the util.printf method in Acrobat JavaScript to properly round a field value.

I also wouldn't quotes on numeric constants.

var r1 = this.getField ("V1");
var r2 = this.getField ("V2");
R1. Hidden = true;
R2. Hidden = true;

If (util.printf ("% 1 .2f", event.value))<= 1.00)="">
R1. Hidden = false;
}

If (util.printf ("% 1 .2f", event.value) > = 1.01) {}
R2. Hidden = false;
}

Tags: Acrobat

Similar Questions

  • 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é

  • 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 field on all pages problem

    I try to use a script to show/hide document level menu (via a drop-down list) field on a 6 page document.

    If my domain is named "P1.field" on page 1, P2.field on page 2... How can etc, I do for States to field by doing the same?

    Right now my state of field changes on page 1 only.

    Just do it to all fields... Either in a loop or one by one. You can use something like this, for example:

    for (var i = 1; i)<=6;>

    this.getField("P"+i+".field").display = display.hidden;

  • 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.

  • 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.

  • How can I have 7 txt calculate and/or show/hide fields?

    I have 7 fields txt. As follows, ST1, ST2, ST3... ST7. With 1 TotalST field for all areas 'ST' (that calculates totals fields). Is what I want to do, when the ST fields are not met, then the TotalST field would be hidden. When one or all the fields St are filled the TotalST field would be visible, but also calculates the fields of ST. Then the TotalSt would hide if I delete the entry of all fields of ST.

    At the moment, I have the calculation works fine (fairly simple) by using the simplified window. But, in my opinion, it takes a javascript that will have to be placed in the window of custom calculation. So, can someone provide a script that would do what I hope to do? Thank you.

    Sure. Use this code instead of the one above:

    Event.Target.Display = (event.value == 0)? Display.Hidden: display.visible;

  • Show/hide field

    I was wondering if it was possible to hide certain fields before the form is submitted/sent by e-mail so that the person who receives this form will not be able to see these fields but still be captured by the database?  Is this feasible?

    Here is an example that may give you some ideas...

    https://Acrobat.com/#d=e44sIFR9uXi1P4nrB * ZQYQ

    In this example, I placed a subforms with text in them. When you click on email, a subform is hidden in the event of pre-press. After receiving the e-mail, you will see a subform.

    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.

  • Show/hide subform with Radio

    I try to get a subform to be initially hidden and visible only when one of the option buttons are selected.  I looked and looked on these forums and tried all the different combinations, but none work.  I have radio buttons in a subform that is different then the elements want to hide. Any help would be great.  Here is an example of what I have.    Form1. Design1.ITManQuest.ITMan::change - (JavaScript, client) (this is where I put the script) if (this.rawValue == '1') {Design1.Routing.Signatures.ITSignSub.presence = 'visible' ;} else {Design1.Routing.Signatures.ITSignSub.presence = "hidden" ;}

    Thank you, download it now

    Looks like you are hiding a few lines in the following table when you click No on the radio at the top group? If Yes, then you must save the PDF dynamic form. At the moment its registered in static pdf. Nothing will happen when you click on no, the provision cannot be changed to static pdf of the way you are trying to do. Just resave as dynamic and the overview should start working properly.

    Probably needs on the subform ITSignSub hidden initially

  • Hide/show a field

    I'm puzzled. I created a box, and I "Mouse Up" to show a hidden field. But when I uncheck the box, the field is still visible. I'm very novice and could use some advise. Thank you!

    Using a checkbox to show/hide fields can be done, but don't not using a mouse event like that it will be a permanent change.  Instead, you can use two buttons, one to hide a specific field and the other to show.  Alternatively, you can use a checkbox and script a bit to work.  C1 is the name of my box and text 2 is the area I want to show or hide. I also gave my box an export value of 2 just arbitrarily.  By placing the script in the field calculate Text2, it will determine if the checbox is verified through tests to see if it has a value of 2, it will have only if verified.  If it isn't then the field is hidden if it is not, then field is visible.  It's a start.

  • Need help with show/hide Div position

    WDRC project site

    I use a show/hide behavior with my menu items. If you mouseover all the links (except the home), you will see an image with some text appear below. The one shown in the right position is the "press room". The rest are falling down, based on their position within the Division 'description' how can I do each of their ascent to the proper position when their respective link is wriggling on?

    Thanks a lot for your senses! Problem solved.
    :-)

  • Problems with the layout themed to show/hide the region 25

    Hi all, Ive hit another question that I hope someone can help with...

    APEX 4.2.4 on XE... Theme 25.

    I've reproduced this login as apex.oracle.com [email protected] password newpass 291 3 application page.    (admin/admin is also implemented as a UN/pw)

    I have a skin region see the this Im using as a region of select query. There are a number of boxes, and a couple of display only fields that have values returned in it.

    I I set out them in a row, and after 3 items, I start a new line with the other 3 articles... that is

    X X X

    X X X

    Except that with the region set to show/hide and the model of the value without tab, no sidebar I get.

    X X

    X

    X X

    X

    If I change the standard region it works OK, and if I change models, it seems ok.  Ive tried all the combinations of columns, etc, but nothing helps...  Im trying to figure out if Im missing something, or I've hit a bug any... (almost certainly the old...) ...

    Thank you very much indeed

    Richard Legge wrote:

    I have a skin region see the this Im using as a region of select query. There are a number of boxes, and a couple of display only fields that have values returned in it.

    I I set out them in a row, and after 3 items, I start a new line with the other 3 articles... that is

    X X X

    X X X

    Except that with the region set to show/hide and the model of the value without tab, no sidebar I get.

    X X

    X

    X X

    X

    If I change the standard region it works OK, and if I change models, it seems ok.  Ive tried all the combinations of columns, etc, but nothing helps...  Im trying to figure out if Im missing something, or I've hit a bug any... (almost certainly the old...) ...

    The difference between the models of the region is that the Standard region has defined Points of view and the show/hide does not work. This is the mysterious properties that Oracle has not yet bothered to document. Their omission of this model is indeed likely to be a bug.

    Create a copy of the region show/hide template and add a point of view for the body of the region (content):

    Name: Body of the region

    Substitution of template: BODY

    Grid Support: Checked

    The maximum fixed grid columns: - 1


    Use the new model to show/hide for the region of select query.

  • 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/hide the image with audio (audio does not if necessary)

    Then, I ran some tests to see what was going on so I could better explain my problem.

    I have a slide with a picture that has four clickable areas. First of all, the student listen tell me for a few seconds and then is invited to click on the image areas that are highlighted.

    When the user clicks on one of the fields, an image appears and I taped audio on this 'object '. Note: I didn't use the slidelets substitution as the clickable area is hidden by the new image when the image appears on a click. The user will press a close button that is on the image, set with another clickable button to hide the image then select another pop up box. (See image below... you can see the image of forklift under the transparent image gray... This is where the user clicks the highlighted area).

    Capture.PNG

    I tried two ways:

    having the image plays on the whole timeline from beginning to end of blade (be hidden with the show/hide button function)... when I do it, the sound will not play at all (I'm guessing that this is because the audio went silently on the first few seconds of being on the screen, so by the time the student clicked the button finished audio).

    and

    Drag the beginning of the image to close the timeline when the user is asked to click on areas of the screen... when I do that, the sound play a bit, but gets cut off after a few seconds.

    If I click on the areas as soon as the blade begins to play (since i KNOW where the buttons will be activated), the audio plays very well which makes me believe my theory that the audio runs just at the moment where the user gets to click on it.

    There is no break on one of the buttons around this period, so I know this isn't that.

    What I am doing wrong?

    Thank you! :-)

    I'm happy to say after hours of frustration, I finally got to work.

    I went and read your blog Lieve on micro navigation and managed to keep the images at the point of the slide where the user is asked to click on them and define the action of tip:

    to display the image,

    hide the other images and

    Use the assign with 705 rdcmdgotoframe

    and added a line to continue so it wouldn't break (if I do this, it seemed only allows only not the last his image clicked / or show the function works because I have an action secondard on the second tab to display the button 'next' once all are clicked).

    I had to do the math, but thanks to your info on your blog, I was able to understand this. I just tested it and it works... so I'm not going to save and close and breathe until Monday when I can run my final tests on the entire project!

    Thank you!!

    ~ Gina

Maybe you are looking for