APEX 4.1 show hide fields based on value of checkbox/radio

I am trying to successfully hide and show fields based on the value of a clicked checkbox.  I am using a dynamic action, but it isn't working. 
I followed the sample at Does Oracle Apex 4 enable the following AJAX features? (ie without the dev writing the Javascript) - Stack Overflow
I even tried a radio button, but it didn't work.  I cannot uncheck the radio button.  What am I doing wrong?  Thank you for any help you can provide.

Hi,
     create a dynamic action for page load to hide the item which you wanna hide
     now create another dynamic action
     event : Click
     Selection Type : Items
     Items : P1_Check_box(name of the check box item)
     condition : equal to
     value : return value of the check box item (if you click the check box and the return value is 1 then just add 1)
     in true actions
     Action : Show
    Selection Type : Items
     Items : P1_Text_field(name of the field)
     uncheck fire on page load
     create exact opposite false action, that's it.
Regards,
Mohan.

Similar Messages

  • Show / hide field based on text in another field

    Hi,
    I'm trying to make one of my fields reactive to what is the text generated in another field.
    At the moment I have this under calculate using custom javascript:
    var Mask = this.getField("Course").value;
    if(Mask == 'Swimming') this.getField("Code").display = display.visible;
    else this.getField("Code").display = display.hidden;
    Whereas Course is the field that is changing and Code is the one that will show/hide based on content of Course.
    Any help?

    Hi Everyone,
    After doing trials with simple calculations it still wasn't working and so I've figured out what the problem is - the document was being exported but with the data being pre-populated from an SQL database in which during the export it all happens at once, not a chain effect so when the export happens it was filling "Code" before "Course" had any info in it...
    The fix was basically having to create a different field in the SQL source itself for an independent field on the pdf form.

  • Show/Hide Fields Based on Dropdown

    Hi,
    I am attempting to show/hide subforms with a dropdown selection. I've found a lot of information on the subject, and have ended up with this as 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 is not doing anything when a selection is made in the dropdown box. I have the "SubformZZI" initially set as "Visible" and the "SubformZZR" initially set as "Hidden".
    Any suggestions?
    Regards,
    ZeroZone

    You have wrongly referenced the fields in your code.
    Copy and paste the below code in the click event of the Submit button. It should work as expected.
    The code thathas error is commented..
    // First check if there are null values, then construct email using script
    var vEmail = "";
    var vSubject = "";
    var vBody = "Attached to this email is a Field Service Issue - Parts Order Form for Job #" + Page1.JobNumber.rawValue + ".";
    var vName = "";
    var vCC =  "[email protected]" + "," + Page1.RSM.rawValue + "," + Page1.IssueLeaderEmail.rawValue; 
    var vFormat = "PDF";
    var errorMessage = "At least one required field was empty. Please fill in the required fields (highlighted) before continuing.";
    // Check required fields and build error message
    if (Page1.IssueLeaderEmail.rawValue == null)
    errorMessage = errorMessage;
    else
    vSubject = "Field Service Issue - Parts Order Form for Job #" + Page1.JobNumber.rawValue;
    // Check Division field
    if (Page1.Division.rawValue == "Case Division")
         //vEmail = Page1.SendFormToZZI.rawValue;
         vEmail = Page1.SubformZZI.SendFormToZZI.rawValue;
         //vCC = Page1.SendCopyToZZI.rawValue + "," + Page1.CSTZZI.rawValue;
         vCC = Page1.SubformZZI.SendCopyToZZI.rawValue + "," + Page1.SubformZZI.CSTZZI.rawValue;
    else
         //vEmail = Page1.SendFormToZZR.rawValue;
         vEmail = Page1.SubformZZR.SendFormToZZR.rawValue;
         //vCC = Page1.SendCopyToZZR.rawValue + "," + Page1.CSTZZR.rawValue;
         vCC = Page1.SubformZZR.SendCopyToZZR.rawValue + "," + Page1.SubformZZR.CSTZZR.rawValue;
    // If fields required for script are null, warn user and do not initiate email
    if (Page1.IssueLeaderEmail.rawValue == null)
    xfa.host.messageBox(errorMessage, "Sending an email", 0, 0); // Send out a custom error message if any of these fields are null
    else
    // Everything is OK, send email
    event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody + "&cc=" + vCC,cSubmitAs:"PDF",cCharset:"utf-8"});
    Thanks
    Srini

  • Show/Hide fields based on choices in drop down menu

    I need help with a script that I cobbled together from an example script; I'm not good enough at java to edit it for my needs.
    I have a form where I would like different drop down fields would be visible/hidden depending on the choices made from other drop down menus.
    If (for example) they select paper type "white" or "color" then "white" will result in a second menu of paper choices, the "color" selection result in them picking the paper wieght, then from there the color.
    My problem stems from the fact that my form is very linited in space, so I would like some of these fields to be essentially on top of each other; visibility dependant on previous choices. I can get to Menu 1 (select paper color) and then Menu 2 if they select white. But there's a problem with setting up a third menu in this series, if they select "color" from Menu 1, then I try to have a drop down for paper weight, all the fields except for Menu 1 are hidden. Playing with the script let me have them all visible, but again, I'm limited on space and can't really spread them out.
    I know I'm missing one small command... somewhere.
    Here is the script I'm working with:
    function control_section_fields() {
        if (event.willCommit) return;
        // Get the value selected in the combo box
        var section = event.changeEx;
       // Hide all of the entry fields
        getField("sec").display = display.hidden;
        // Reset all of the entry fields
        resetForm(["sec"]);
        // Display the fields for the selected section
        getField("sec." + section).display = display.visible;
    where the drop down fields are named "sec.a.dd" for example, and the Export value of different values are assigned as "a", "b", etc.
    Sorry for the rambling. Any help will be greatly appreciated.

    also, if "==" could be roughly translated to "is", "!=" would mean "is not".
    JavaScript is Case sensitive so make sure you did not name your field STATE#1 instead.  It's a pretty common error.  Try not to use special characters when naming fields.  Stick to standards.  I personnally always name fields with capital letters and numbers using identation like
    MYFORM.PLACE.NUMBER
    MYFORM.PLACE.ADDRESS
    MYFORM.SEX.MALE
    MYFORM.SEX.FEMALE
    This is really useful if you have lots of fields related to one another.  You can then apply methods to entire groups of fields in one simple line of code.
    For example this.getField("MYFORM").display = display.hidden would hide all four fields.  It works kind of the same way as folders unside your computer.
    Finally, "#" is generally used as widget identification.  I think this is what happened.  If you copy a field, it retains the same name and some of its charateristics but acrobat will assign them a number called widget.  The original field State will get the identification State#0 in the right pane as it is 0-based.  The copie will be identified State#1.  You must understand that the name of the field is still "State".  Some methods (actions you can code) let you determine the widget number for targetting a specific field from those you copied.  It is not the case here.  So for disambiguation, you should name your fields different name like STATE1 and STATE2, or STATE.1 and STATE.2 if you plan to use what I wrote about earlier.

  • Show/hide fields when selecting an option from a drop-down menu.

    Hello Gurus!
    I have a question about creating a Java Script withing Acrobat pro.  This is what i would like to do: I created a drop-down menu with several selection entries.  Upon the customer making one of the selection entries, i would like for the correct fields that i created to become visible and all other fields to hide.  Is this even possible to do?  The reasoning behind this is because we have a form that customers have to generate in order to request access to certain financial accounts; we have over 20 different types of accounts and for each instance the customer has to fill out the same form.  By creating a drop down menu, i can use the same form by just changing the drop-down selection and clicking on the designated fields for that selection.  At this time i have over 20 different forms that poing to 20 different account requests and i would hate to send the form 20 different times to one person.  The reason i can not add all fields desired for all accounts is due to the fact that the form would be filled with hundreds of checkmarks and instructions thus making the process too tideous for the customer.  Hope you guys can help out.
    ~Vader

    The good news is, it can be done (and it has been done).
    There are a few things to be aware of, however.
    The most important is that the form must be planned well, which means that you must think carefully about your logic and even more so about your field naming (hierarchical field names are your friend). One fundamental issue, you have to be aware of, is that this form no longer will be a "standard form". The consequence of this is that you may have to be aware that you might get into trouble when you have to prove that your user filled out that particular standard form (talk to your compliance and forms management people about that).
    You also may have to decide whether the form should be usable in Reader. And, if so, how much you want to spend on the right to do so. You will see below why…
    There are actually two approaches for dynamically showing/hiding parts of a form. If your form can be separated between a fixed first page (where you also have the account type selection), and a variable part (depending on the selection), you could use Templates, which you spawn according to the selection, and delete pages when you change the selection. This approach is very easy to implement, but requires Reader Extensions Server to allow it to work in Reader; Acrobat Pro's extended rights are not sufficient for that.
    The other approach is showing/hiding fields. If you did your homework well, it would be very easy to first hide all subsequent fields, and then show the ones you need in two lines of code. This approach does not require extended rights for Reader at all, as long as your forms will always have the same number of pages, for each of your account types. This approach also works for the cases where the differences between the individual forms are very small. It does also work for showing/hiding bigger chunks of the form. In that case, you might create the "background" separately, and then put it as an icon into a button field which you will show/hide together with the carefully placed on top of it active fill-out fields.
    There is a third possibility, which Adobe Propaganda probably would suggest, and that woudl be subforms in LiveCycle Designer. The consequence is, however, that you won't have PDF forms, but proprietary XFA forms instead. And you may have more developing and maintenance work than with the other approaches.
    Back to your original question: you could use a Keystroke script evaluating event.changeEx of the combo box field. Depending on that, you would run your action to set up the according form part. The other way to do it would be evaluating event.value in the onBlur event. The latter would have the advantage that the selection has been made, and you get a bit more time to set up the form (this may in fact be an issue, particularly with Acrobat 9 and 10, which may take their time to show/hide fields).
    Another possibility instead of a drop down (combo box field) would be a popup, where you would have a button to press, and the list of selections pops up. This second method uses app.popUpMenuEx().
    Hope this can help.
    Max Wyss.

  • Show or Hide fields based upon a variable value

    Hi,
    I am a rookie in the field of Acrobat. And my only question is :
    How to Circle a Form Field based upon a variable value .
    For example, If x=1, I want to circle Japan and if x=0, I want to leave it without any change.
    Please help me out. Thanks for your time and help.
    Thanks,
    Vijayvijay77.

    Hi George,
    I am pre-populating a Pdf file based upon the data submitted by the user. And I have to circle options selected in the form.
    I am writing coldfusion code to flatten, populate the form into a PDF form. The end result is the PDF generation with all the data in it.
    The data comes from the database, where I set variable values if any is selected or not.
    Thanks for your reply, I really appreciate your help.
    Vijayvijay77.

  • PM Notification - Hide fields based on other field's value

    Hello experts,
    I am looking for an user exit which allows me to hide some fields based on other field's value.
    For example, I have field 1 and field 2. When I open my notification, if the value of field 2 is 'aaa', field 1 has to be hidden.
    There should be an user exit but I can't find it...
    Thanks for your help!

    Hi everyone,
    Any thoughts? any help is appreciated...
    Thanks

  • Dynamic action - show/hide region based on LOV which returns ID

    Hi folks,
    this should be simple, so someone who works with dynamic actions.
    I have a LOV which is based on below query:
    select OBJECT_ID, KOD
      from x_data x;
    retuns:
       ID          KOD
        492961 BMW
        492964 VOLVO
        492960 MERCEDES
        492963 VOLKSWAGEN
        492959 SKODAItem :P200_KOD is based on LOV which displays KOD and returns ID.
    On my page I have also 1 region called TEST_REGION.
    I would like to set up a dynamic action shich will SHOW/HIDE a TEST_REGION based on selected value in item :P200_KOD (LOV). Region should be showed if displayed (KOD) value of selected ID starts with 'V%'
    By other words, if below query returns any record, then SHOW, else HIDE:
       select *
        from x_data x
      where x.kod like 'V%'
         and x.object_id = :P200_KOD;How should I define a triggering condition for dynamic action, for item :P200_KOD?
    Thanks,
    Tomas

    Hi,
    One way:
    Create advanced dynamic action.
    Name : Hide region
    Event : Change
    Selection Type : Item(s)
    Items(s) : P200_KOD
    Condition : JavaScript Expression
    Value :
    $(this.triggeringElement).children("option:selected").html().substring(0,1) !== "V"Action : Hide
    Fire On Page Load : True
    Hide all page items on the same line : No
    False Action : Show
    Fire On Page Load : True
    Show all page items on the same line : No
    Selection Type : Region
    Region : TEST_REGION
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to show/hide total based on selected column in column selector

    Hello,
    Is there a way to show/hide the total based on what column is selected in the column selector? Or alternatively to hide the total based on the column selected? I'm using OBIEE 10g.
    Basically, I have a pivot table with a handful of row variables and one measure. Then I allow the user to select the column variable. The default is to have nothing, which I have achieved using the hidden/dummy column trick (Re: How to add new columns by using Multiselect However, if my pivot table is set to have a total, I now get 2 columns that are the same. When the user selects any other choice (e.g. gender), I would want to see Male, Female and the total. Something like this:
    Default:
    Count
    East 10
    West 20
    Total 30
    Gender:
    Male Female Total
    Count Count Count
    East 6 4 10
    West 14 6 20
    Total 20 10 30
    Any thoughts?
    Thanks!

    I recommend using view selector instead of column selector

  • Show/hide field options are grayed out

    If a drop down value is 1, I want to show field #1. If the drop down value is 2, I want to show fields #1 & 2. If the value is 3, I want to show fields # 1 2 & 3, etc. This appears not to be possible; a show hide rule is already created for value 1 and appears unavailable for a new rule for value 2. Any ideas for a workaround?

    Yes you can do this using the hide show logic. In the case you describe you want to use the if any rule rather than the if all rule. For drop down item one the logic is if any (1, 2 or 3) are selected show item one. For item two the logic is if (2 or 3) are selected show item 2.
    Andrew

  • Visual studio reports for crm (fetch xml) - trying to hide textbox based on value returned

    I have a report running from a custom entity in Dynamics CRM online using fetch XML and all is well apart from trying to hide a text box which shows an expression.
    The expression refers to a boolian value from CRM (two options - Approved and Unapproved), what 'I want is the textbox to show the contents if the value = Unapproved but hide it if = Approved.
    I have gone into the text box properties and selected visibility - show/hide based on an expression.
    Here's what I have which isn't working.
    =IIf(Fields!dsm_dispatchapproval.Value like"Approved")

    Hi duddit2,
    Based on your description, you want to use an expression to control the visibility of a textbox. Show the textbox when the value of dsm_dispatchapproval field is “Unapproved”, hide it when the value of dsm_dispatchapproval field is “Approved”.
    To achieve this goal, please refer to the following expressions:
    =Fields!dsm_dispatchapproval.Value like "Approved"
    OR
    =IIF(Fields!dsm_dispatchapproval.Value ="Approved",true,false)
    For more information about Expression Examples (Report Builder and SSRS), please see:
    http://msdn.microsoft.com/en-IN/library/ms157328.aspx
    If there are any other questions, please feel free to ask.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Suppress fields based on values

    Hi, I am trying to create an expense report in livecycle where if someone selects from a drop
    down, based on the result picked, it would show a different field to fill in.  If they don't pick a specific dropdown that has extra fields, then those fields stay hidden.
    For example, if they pick "mileage" from the dropdown, it will show a field to put in the mileage and then the total would show the qty * mileage rate.
    If they pick "meeting", it would show a field to put in the description of meeting and another field to put in attendees.
    I'm not sure how to do "hidden" fields.  I know how to do suppression formulas in crystal but don't see that as an option with livecycle.  Please help!

    Hi,
    First off, there is an example here which goes through the scripting method of changing an object's presence: http://assure.ly/h7whb8.
    The easiest way may be to group the objects for each category of the dropdown into subforms and then show and hide the subforms as necessary.
    For example the following in the exit event of the dropdown:
    // hide all subforms
    travelSF.presence = hidden;
    meetingSF.presence = hidden;
    // check the value of the dropdown and show the appropriate subform
    switch (this.rawValue)
         case "Mileage":
         travelSF.presence = "visible";
         break;
         case "Meeting":
         meetingSF.presence = "visible";
         break;
    Now a lot depends on whether you are using repeating objects in a flowed layout, where the user can add more rows. IF so you may need a more detailed solution.
    Hopefully this will give you a start,
    Niall

  • Display text fields based on value

    I have a form that has 7 text fields that are to be filled out. I have an ajax process that auto-populates those 7 fields with values based off of the return value of a pop-up dynamic LOV. Is there any way that I can hide the last 5 fields based on a certain value of one of the text fields?
    For example, my fields are:
    P1_Badge (LOV query)
    P1_First_Name
    P1_Last_Name
    P1_Title
    P1_Phone
    P1_Room_No
    P1_Email
    P1_Fax
    The LOV returns a Badge number and populates the rest of the values. But if the Last_Name = 'Smith' then I only want to display Badge, First_Name, and Last_Name and I want to hide the rest of the fields or make them disabled for editing.
    Is this possible without any kind of page submit?
    Thanks,
    Dirk

    Hello,
    Take a look at this page http://apex.oracle.com/pls/otn/f?p=11933:39 it has examples of what you want.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Disable a field based on choice of a radio button

    Novice JS user here.  Trying to disable a text field in a pdf based on the selection of a radio button and if a specific radio buttons are
    selected, take the user to a specific field.  Ex. Married/Single, Male/Female.  So if they select Married & Female, it will take them to the Maiden Name text field.  If they select Male or Single/Female, the Maiden Name text field will disable.  I would appreciate any help on this.

    See Hiding and Showing Form Fields by Thom Parker.

  • Populate f4 values of a field based on value of other field

    Hi,
    I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
    How will i achceive this requirement.
    I got a link about the same but that is not using WDR_SELECT_OPTIONS
    http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
    I got another link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    which I am going to try
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AM

    Hi,
    Using OVS you can achieve this.,  In OVS Event Handler read the value based on which you  want to display F4 for other field and populate the values based on the first field.
    this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    hope this helps u.,
    Thanks & Regards,
    Kiran

Maybe you are looking for