Using JavaScript to Hide/Show Items

Hello
Trying to use Javascript to check a List Item value.
IF List Item value IS NULL THEN
HIDE some other items
ELSE
SHOW some other Items
I managed to locate some code to determine a NULL value.
This works and I even can display a an alert message
When I attempt to Hide the other Items, nothing happens
Any Help on this matter - Urgently required for a Deadline
Here is the code I am using :
function show_InvestigatorData(){
var lCheck = html_SelectValue('P1000_INVESTIGATOR_ID');
// if Investigator populated, show the Investigator fields
if(lCheck &&
lCheck != '' &&
lCheck != 'null' &&
lCheck != '' &&
lCheck != ' '){
alert('this value is ' + lCheck);
html_ShowItemRow ('P1000_INVESTIGATION_START_DATE');
else {
// otherwise hide the Investigator fields
alert('this value is null');
html_HideItemRow ('P1000_INVESTIGATION_START_DATE');
Many Thanks in advance
Ade

Ade,
Carl Backstrom has a great sample site with examples of what I believe you are trying to accomplish:
http://apex.oracle.com/pls/otn/f?p=11933:5:661046971170606::NO:RP::
From either the menu or the index, select Javascript and then "Show/Hide/Toggle Form Items".
Hope you don't mind the plug Carl.
MovingTarget

Similar Messages

  • Javascript help - Hide/Show a page item

    Environment:
    APEX 3.1.00.09 running on AIX 5.3
    Sample application on apex.oracle.com:
    Workspace: GALWAY
    UserID: gwicke
    Password: gwicke
    To see where my issues are:
    1- Start on page 3
    2- In the Agency drop down select 'J & B Marketing'
    3- In the Contract drop down select the only contract that appears
    4- Click on 'Edit Existing Contract'
    5- Note the page item 'LY Closings' has the value 261
    6- Click on the link (really a tab in my theme) at the top labeled 'Cost Detail'
    7- The 'Estimate Justification' is the page item to be displayed/hidden as noted below.
    8- The 'Homes Per Year' under the 'YEAR1' column is the user input page item
    9- The P2_BUILDER_CLOSINGS (value 261 noted above) is the page item to be used in the comparison
    I need to do a couple of things with a potentially hidden page item:
    1- Every time the page loads I need to check to see if the page item (P8_ESTIMATE_JUSTIFICATION) is not null and if it is indeed not null, make it displayed.
    2- When the user enters a value in another page item (P8_HOMES_PER_YEAR1), call a function to see if that value is more than 120% of another page item (P2_BUILDER_CLOSINGS) and if so make the above page item displayed (P8_ESTIMATE_JUSTIFICATION).
    I have the javascript function created (showHideEstimateJustification) and in the HTML Header of the page. The function is being called currently with an onChange check on the page item entered by the user as noted above (P8_HOMES_PER_YEAR1).
    Issues:
    1- I need to force a SUBMIT after the user enters the value for P8_HOMES_PER_YEAR1 so it is available in session state and hence to the javascript function (other ideas welcome!)
    2- I am currently using the x.style.display = 'inline' versus 'none' to hide/show the page item, where x is derived from var x = document.getElementById(P8_ESTIMATE_JUSTIFICATION) Is there a better way????
    Any help is greatly appreciated.
    -gary (a.k.a. Javascript newbie)

    Hi,
    Only your messages use the session state. The code would use the entered value, but you would need to change:
    var homes = parseInt(document.getElementById('P8_HOMES_PER_YEAR1'));to
    var homes = parseInt(document.getElementById('P8_HOMES_PER_YEAR1').value);so that "homes" becomes the numeric version of the value of the item
    Normally, for the label, you would just enter an ID="xxx" into the HTML Table Cell Attributes for the label which you can then use in your javascript. For some reason this doesn't seem to want to work in this page.
    What you could do is find all the labels and then check which is the right one before showing/hiding it. Something along the lines of:
    var xx = document.getElementsByTagName("LABEL");
    var zz;
    var label;
    for (zz = 0; zz < xx.length; zz++)
    if (xx[zz].htmlFor == 'P8_ESTIMATE_JUSTIFICTION")
      label = xx[zz];
    xx[zz].style.display = 'none';
    {code}
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using Javascript to hide objects that have no "binding" tab?

    Hello,
    I'm attempting to create a form that uses checkboxes to hide a variety of fields. I've run into a problem though; it seems that only text fields have a binding tab (unless I'm missing something).  Is there a way for me to do show hides for images and text boxes? When I hold ctrl and hover over these items there is a small circle with a red line through it, which seems to express that it is impossible to manipulate them using javascript.
    For the record, I'm using javascript as seen below:
    BusinessDBAname.presence = "hidden";
    If someone had any definite answers on this I'd really appreciate it.

    Hi,
    sorry to say that, but this is a really bad form design.
    There are a couple of things you can make it better.
    1. Give unnamed subforms a suitable naming
    2. Use subforms to organise your form
    3. Don't embed fonts at all when you only use the default fonts Arial or Myriad Pro
    4. Don't select the checkbox to embed images (they will get embedded always but this method requires more space)
    5. Set option to prevent script changes in the form to automatically, otherwise the changes wont be saved
    Ok, I suggest you to create a set of subforms to represent your Section 1 - 9.
    In each subform you then add a subform for business and sole proprietor.
    Into those subforms you then put the desired fields, images etc.
    This allows you much shorter scriptings because you only have to change the presence of the surrounding subforms to show/hide an entire set of objects.
    You form design finally should look something like this.
    form1
         Maserpage
         PayeeSetupRequest
              Section1
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section2
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section3
    Hope this helps.

  • Using HTML to hide/show content?

    I'm creating an app which is essentially a user guide, for example let's say the guide is for 10 different people. The guide consists of 40 pages, 38 pages are master pages but the last 2 pages has to be different and designed specifically for the 10 users, the last 2 pages has to have individual specific content.
    could i create a html login page that could check a database that hides or reveals the last 2 pages to the correct user?
    could i create a combo-box that allows a user to show information relative to them?
    is there a way to create 1 app that can have variable content to multiple users?

    Ade,
    Carl Backstrom has a great sample site with examples of what I believe you are trying to accomplish:
    http://apex.oracle.com/pls/otn/f?p=11933:5:661046971170606::NO:RP::
    From either the menu or the index, select Javascript and then "Show/Hide/Toggle Form Items".
    Hope you don't mind the plug Carl.
    MovingTarget

  • Using javascript to hide/enable sections on a dashboard

    Hi,
    Version - OBIEE 11.1.1.6.1
    I am trying to display/hide a section based on the user selecting a value from a radio button(variable prompt). These sections contain reports(which use different filter criteria) and have different prompts .
    ie If value A is selected in radio button, prompt C and report D should be visible
    if value B is selected in radio button, prompt X and report Y should be visible
    I am able to do this by using condition(which uses a hidden analysis) on a section but that refreshes/reloads the report sections even before the corresponding prompts are applied which does not provide a good user experience.
    Can this be done by Javascript?
    I am able to hide a section through javascript based on radio button selection by calling - saw.dashboard.onToggleSection('<dashboard-section-id>',null);
    However I am not able to find a way to enable the other section. Has anyone been able to use JS to hide/unhide a section?
    Any suggestions/inputs appreciated
    Edited by: layman on Oct 17, 2012 12:55 AM

    I really don't see why there would be a need to script wildly when you can easily achieve this with conditional reports which are just listening for the values currently in the radio buttons, return some bogus line and then enabling or disabling sections.
    E.g. section condition: ROWCOUNT("DoesTheRadioButtonSayBlaBlaBla") > 0
    C.

  • Javascript To Hide/Show Complete LOV Item On Page

    Hi All,
    I am trying to show/hide a page item which is a LOV page item type. I was using the $f_Hide_On_Value_Item which does not hide LOV image. What should I use to accomplish this ? It has to implemented in Javascript. Any help appreciated ...
    Tom

    Hello Tom,
    >> Are there other options ???
    There are usually other options :)
    Scorpio idea is a good start, although I‘m not sure his code cover the label of the LOV item. I think for that you should go one level up in the DOM. Using the ID suggestion he gave you, try using the following line:
    $x('popUp').parentNode.style.display = 'none';That should hide the entire ‘tr’ the LOV item is on.
    Hope this helps,
    Arie.

  • Using jquery to hide/show field based on query results

    I have a form that includes fields for country and state/province.  Initially, the state field is hidden.  When the user selects a country, I use a bind expression in the state field to get the states in the selected country.  I want to display the state field only if the country has states (since some countries don't).  Can someone tell me how to do this?  Here's the relevant stuff:
    <script>
        $(document).ready(function() {
            $('#stateID').hide();
            $('#stateIDLable').hide();
    </script>
    Country:
    <cfselect name="countryID" query="qryCountries" value="countryID" display="country" />
    <div id="stateIDLable">State or Province:</div>
    <cfselect id="stateID" name="stateID" bind="cfc:geography.getStates({countryID})" />
    Thanks.
       Pete

    I presume you have a JavaScript function that handles the results of the cfc binding?
    If you don't you will need to incorperate one.  Then, as well as populating the second select, this function can use logic to show the second set of controls.

  • Using javascript to hide ap divs

    I want to write a function to hide 8 ap divs on my page, because I need to do this from various places, and using the show/hide behaviour is proving very timeconsuming, as every time I replace my images via the FW generated HTML, I have to reinstate the show/hide behaviour 8 times for each image.  Much easier if I could just call a function.
    I have scoured the net, and come up with various samples along the line of:
    document.getElementsByName('apDivName').style.visibility = 'hidden';
    which I repeat for each apDivName in my list.
    The problem is, I don't know javascript, and have no idea if getElementsByName is the right getElements or if visibility is the right property,but have tried various permutations on this theme.  No syntax error, but the functions called after this function don't run, so something is wrong.

    It's ok, I sorted it.
    document.getElementById('apDivName').style.visibility = 'hidden';
    I'd tried that already, but missed a capital letter in my function name, so it didn't work.  Duhhhh.

  • Hide/Show items in Multiple selection in InfoPath 2010 Form

    I have an I an InfoPath 2010 browser enabled form with four sections. Inside each section is  a checkbox and a textbox
    What I need to do is, have a user select a desired items by checking the checkBox and the items that are not Checked are hiden. They can select (Checked) all the four CheckBoxes. I am using rules but can't seems to get this working. Any help will be appreciated.
    Ebenezer

    Ok, here is how you have to do , use expression as I mentioned in my previous post, and then use a condition like this
    (../my:group1/my:field1 = string(true()) and ../my:group2/my:field4 = string(false()) and my:field6 = string(false())) or
    (../my:group1/my:field1 = string(false()) and ../my:group2/my:field4 = string(true()) and my:field6 = string(false())) or
    (../my:group1/my:field1 = string(false()) and ../my:group2/my:field4 = string(false()) and my:field6 = string(true()))
    here I am checking for all three fields, if either of these is true then it will hide other section
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Hide/Show Dynamic Action Stopped Working

    Good Morning,
    Once I upgraded my application to Apex 4.2.2, my dynamic action stopped working. It worked fine in 4.1.
    I also used javascript to hide/show my fields.
    code below
    <script language="JavaScript" type="text/javascript">
    function onPgLoad()
    //hides reporting select, unless certain utcs are selected they are selected
      var ForceGenUTCSrch = $v('P310_FORCE_GEN_UTC_SRCH');
      var RptMenu         = $v('P310_REPORT_MENU');
    if  (RptMenu == '1'&&(ForceGenUTCSrch == '0GTAA' || ForceGenUTCSrch == '8MMUB' || ForceGenUTCSrch == 'CCMAR' || ForceGenUTCSrch == '0GQGC' || ForceGenUTCSrch == '0GQGB' || ForceGenUTCSrch =='3NNNA' || ForceGenUTCSrch == '3PQAA' || ForceGenUTCSrch == 'XMCAS' || ForceGenUTCSrch == '8NJAA' || ForceGenUTCSrch == 'XMMCB' || ForceGenUTCSrch == '9VCBH' || ForceGenUTCSrch == '3PNAA' || ForceGenUTCSrch == '3PLFA' || ForceGenUTCSrch == '3PMAA' || ForceGenUTCSrch == '3NSAA' || ForceGenUTCSrch == '8NHAA' || ForceGenUTCSrch == 'CBSAD' || ForceGenUTCSrch == 'CCVAA' || ForceGenUTCSrch == '9VDLB' || ForceGenUTCSrch == '3NHAA' || ForceGenUTCSrch=='1HDAA' || ForceGenUTCSrch=='0EZ99' || ForceGenUTCSrch=='0JZ99' || ForceGenUTCSrch=='1AZ99'|| ForceGenUTCSrch=='9YZ99' || ForceGenUTCSrch=='CUZ99'))
        var get = new htmldb_Get(null,null,'APPLICATION_PROCESS=PROC_UTC_RPRTG_ORG',0);
       gReturn=get.get();
        $x_ShowItemRow('P310_FORCE_GEN_RPRTG_ORGN');
       else
         $x_HideItemRow('P310_FORCE_GEN_RPRTG_ORGN');
    </script>
    <script language="JavaScript" type="text/javascript">
    function FunSelUTC()
    //hides reporting select, unless certain utcs are selected they are selected
      var ForceGenUTCSrch = $v('P310_FORCE_GEN_UTC_SRCH');
      var RptMenu         = $v('P310_REPORT_MENU');
    alert(RptMenu);
    if  (RptMenu == '1'&&(ForceGenUTCSrch == '0GTAA' || ForceGenUTCSrch == '8MMUB'|| ForceGenUTCSrch == 'CCMAR' || ForceGenUTCSrch == '0GQGC' || ForceGenUTCSrch == '0GQGB' || ForceGenUTCSrch =='3NNNA' || ForceGenUTCSrch == '3PQAA' || ForceGenUTCSrch == 'XMCAS' || ForceGenUTCSrch == '8NJAA' || ForceGenUTCSrch == 'XMMCB' || ForceGenUTCSrch == '9VCBH' || ForceGenUTCSrch == '3PNAA' || ForceGenUTCSrch == '3PLFA' || ForceGenUTCSrch == '3PMAA' || ForceGenUTCSrch == '3NSAA' || ForceGenUTCSrch == '8NHAA' || ForceGenUTCSrch == 'CBSAD' || ForceGenUTCSrch == 'CCVAA' || ForceGenUTCSrch == '9VDLB' || ForceGenUTCSrch == '3NHAA' || ForceGenUTCSrch=='1HDAA' || ForceGenUTCSrch=='0EZ99' || ForceGenUTCSrch=='0JZ99' || ForceGenUTCSrch=='1AZ99' || ForceGenUTCSrch=='9YZ99' || ForceGenUTCSrch=='CUZ99'))
         //alert(ForceGenUTCSrch);
        var get = new htmldb_Get(null,null,'APPLICATION_PROCESS=PROC_UTC_RPRTG_ORG',0);
       gReturn=get.get();
         $x_ShowItemRow('P310_FORCE_GEN_RPRTG_ORGN');
       //  $('#FORCE_GEN_REPORT1#').show();
       else
         //alert(ForceGenUTCSrch);
         $x_HideItemRow('P310_FORCE_GEN_RPRTG_ORGN');
        // $('#FORCE_GEN_REPORT1#').hide();
    </script>
    javascript: onload="onPgLoad();"I kept the code just in case I needed it @ a later time.
    My Dynamic Action
    Event: on change
    item --> :p310_force_gen_utc_srch (this is a select list that submits)
    conditon --> in list
    value --> '0GTAA', '8MMUB', 'CCMAR', '0GQGC', '0GQGB', '3NNNA', '3PQAA', 'XMCAS', '8NJAA', 'XMMCB', '9VCBH', '3PNAA'
    True Action --> show :p310_force_gen_rprtg_orgn
    False Action --> hide :p310_force_gen_rprtg_orgn
    They both fire on page load.
    The :p319_utc_srch has submits the page because the :p310_force_gen_rprtg_orgn lov runs a query to pull back that units reporting orgs only.
    Please help me figure this out.
    Thanks,
    Mary
    Edited by: MaryM on May 10, 2013 10:52 AM

    Hi Mary,
    So you changed from the code presented to a DA ? I'm not clear as to exactly happens or doesn't happen.
    Do you know if your AJAX calls are failing?
    If you use a Console like the one on Firebug or Chrome you can inspect what's being send and what's being returned.
    I mention this because your htmldb_Get calls looks suspicious.
    var get = new htmldb_Get(null,null,'APPLICATION_PROCESS=PROC_UTC_RPRTG_ORG',0);I would change it to
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=PROC_UTC_RPRTG_ORG',$v('pFlowStepId'));That would pass the app_id and the page_id that is calling. Although this is probably not your current issue.
    See if you can find some javascript error. It's possible that this is a timing problem as to when the code is defined and when it's loaded.
    Thanks
    -Jorge

  • Captivate: Using Javascript to show/hide text captions

    Hello,
    I want to show/hide a text caption using javascript. I can't find the way of doing it with advanced actions. I dont know if it's because it belongs to a question slide in a pool. Does somebody knows if it's possible and how it can be done??

    You can set the length of the variable when you insert it.
    15 characters is just the default setting.
    What I meant by COULD is that the kind of thing you are asking about here (using JavaScript to hide objects inside a Captivate movie at runtime) is not as simple as you'd like it to be.
    JavaScript is not my particular area of expertise, but there are some people that chime in on this forum that ARE experts at JS. But I think they would also be the first to say that it's not as simple a thing to pull off as just "knowing the command to hide/show an object".
    The easiest tool to use in Captivate for showing or hiding objects is Advanced Actions.  The next easiest thing to use is ActionScript 3, and that's hard.  JavaScript is a very useful programming language, but it spends all of its life outside the Captivate movie looking in through AS3's External Interface.  So JS alone is not going to solve all your issues.

  • Bridge Freezes when Show Items From Sub Folders

    Hi all. I am trying to create a portfolio of past works. Using Adobe Bridge and Show Items From Sub Folders makes it easy to go through thousands of files. One major problem though; Bridge is not stable. When I try to view a folder with thousands of files Bridge will freeze and I have to force quite.
    I am running a Mac Pro with Adobe Design CS4 Premium installed. I have 16gb of Ram and have played around with Bridge's preferences and deleted Bridges preference files. I also tried all the options list on Adobe's check list.
    Any help would be greatly appreciated.
    Regards
    Stephen Thompson

    Bridge is not stable. When I try to view a folder with thousands of files Bridge will freeze and I have to force quite.
    As a matter of fact, bridge CS4 is the most stable version of bridge, and although still not perfect yo should be able to view the folder in flat view.
    It only takes a lot of time to cache if you have not done before. If cache does not start you first should try to purge cache for folder using the tools menu.
    If Bridge keeps freezing first thing to try is to restart holding down option key and choose reset preferences. Set prefs again to your own wishes and try again.
    You can also try to first cache the folder using the tools menu. In the folderpanel select the main folder you want to view its contents and go to the tools menu / cache and this time select build and export cache.
    Depending on the amount and size of files it takes some time. Then try again.
    It is able to work, as it does on my system. I have also a main folder that contains around 5000 files organized in stacks and works as it should

  • How to hide/disable menu items using Javascript in Acrobat 9 pro or later

    We just wanted to know on how to hide/disable menu items for e.g. 'Open' menu item under 'File' menu in Acrobat 9 or later on Mac using Javascript. It would be useful if you could provide if any other option is in place already.

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

  • How hard is it to use javascript to show/hide fields. Is it easier to use the action builder?

    I know nothing about javascript and all that ive been using so far has been stuff ive found on here (thank you everyone).
    Using the action builder seems like its gonna be very tedious to do since i have so many subforms that hide, would it be esier to use javascript?

    I know nothing about javascript myself but I just created a form with about 10 different subform that show or hide depending on what the user chooses from a drop down list and I used Action Builder. If we don't know javascript, how can we use it? But Action Builder did a fine job of hiding/showing wherever I needed it. And Action Builder can do more than one thing by clicking that + sign when you are building an action.
    For instance, I needed to place a button in each subform that would close both the field that the person was working in and also the subform on the next page where the information was going into floating fields in a text block that was only visible thru a drop down list text select. I could have never figured out how to do that based on my knowledge of javascript. Thank Adobe for including Action Builder in this version of LiveCycle and I use it all the time. I find it extremely easy to use but it takes a little mental training to think thru the steps of how you can use the menu in Action Builder to make your form do what you need it to do.
    And if all else fails, ask this forum. I struggle for just so long before I come here and ask for help. I always get the answer I need. I hope you will too.
    Good luck,
    Jeanette

  • Validation on items in Hide/Show Region

    I have a validation on an item that is in a hide/show region. I display all my errors in-line with the field. When the validations fires, after the page is submitted, the hid/show region is closed so the user can't see the error. Is there a way in the validation to open the hide/show region so the error can be seen? I had tried this in my validation, but it doesn't work.
    htp.p('<script language=javascript>
    document.getElementById(' || '''' || 'P507_REPORT_SCHEDULER' || '''' || ').style.display=' || '''' || 'block' || '''' ||
    '</script>');

    Hi,
    You can try below steps:
    1) In PR, get handle to Hide Show bean.
    OADefaultHideShowBean hsb = (OADefaultHideShowBean)findIndexedChildRecursive("beanID") ;
    2) Expand the bean by using 'setDefaultDisclosed' property.
    hsb.setDefaultDisclosed(pageContext, Boolean.TRUE) ;
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for