Hide/Show Javascript

Hello,
I have a page with javascript which works in Firefox but not in Internet Explorer.
The functions check to see if an "Other" checkbox is selected. If the box is not selected, then a separate text box should not be shown and vice versa.
Here is the code in the HTML Header and Body Attribute:
function initialMailResp () {
   if ($v('P221_MAIL_RESP_3') != "Other") {
      $x_HideItemRow('P221_MAIL_RESP_COMMENTS');
   } else {
      $x_ShowItemRow('P221_MAIL_RESP_COMMENTS');
function initialCheckAudience () {
   if ($v('P221_AUDIENCE_5') != "Other") {
      $x_HideItemRow('P221_AUD_OTHER');
   } else {
      $x_ShowItemRow('P221_AUD_OTHER');
function initialCheckCommType () {
   if ($v('P221_COMM_TYPE_6') != "Other") {
      $x_HideItemRow('P221_COMM_OTHER');
   } else {
      $x_ShowItemRow('P221_COMM_OTHER');
function initialExpReview () {
   if ($v('P221_RSN_EXP_4') != "Other") {
      $x_HideItemRow('P221_RSN_EXP_DESC');
   } else {
      $x_ShowItemRow('P221_RSN_EXP_DESC');
}Here is the code in the Page HTML Body Attribute:
onload="initialCheckAudience(); onload=initialExpReview();onload=initialMailResp(); onload=initialCheckCommType(); " All are hidden when no "Other" checkboxes are selected in Firefox, but P221_COMM_OTHER and P221_RSN_EXP_DESC are shown in IE.
Does anyone see what is causing the problem?
thansks,
Matt

Hi Matt,
You only need to specify onload once:
onload="initialCheckAudience();initialExpReview();initialMailResp();initialCheckCommType();"Then, as long as none of them do a "return false;", all functions will be run
Andy

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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Hide show button and textual area via Javascript or jQuery

    Hi folks am Apex newbie using 4.0.1 on Vista laptop running OracleXE (for dev purposes)
    A quick desc of what items are on the page of my Helpdesk appkication and what I want to achieve ..
    I have a Progress region defined on the page - with textual areas and some region buttons.
    Details are have 2 textual areas in my region - 1st textual area shows current progress (this is read only).
    Second textual region is where IT person will type latest progress on Helpdesk prob (ticket).
    There is a region button Save Progress Text which when pressed will append text from textual area 2 into textual area 1 and
    also appends text e.g date / time / userid etc of progress text added.
    This all works fine.
    Have added a new region button - call it Enter Progress Text - which I would like when pressed will make textual area 2 and the Save Progress Text buttons visible.
    I can hide and show the textual area 2 via $X_show / hide but cannot for life of me hide the Save Progress Text button.
    I also tried to make a subregion holding textual area 2 and the Svae Progress Text button but again via Javascript / jQuery could not hide the subregion.
    Can someone please tell me the syntax of how to hide via Javascript / jquery as can't find anything much at all in the Apex online documentation.
    Many, many thanks as always.
    P.S Don't want to use dynamic actions or hide / show region as want there to be buttons on screen to make things explicit for user hence my desire to use Javascript.
    Wiggywig

    Hi,
    If its a page item then you can use below script to hide it.
    <script type="text/javascript">
        $x_HideItemRow('Put your item name');
    </script>*Put this code in page footer..                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Hide / Show region template - how to make it stay visible after NEXT& PREV?

    Hello,
    I am using the Hide / Show region template (by the way great idea to create this template ;)
    By default the region is hidden. If i want to see the region content (it is a report) I click on that icon and it becomes visible. For my report I use the pagination "ROW Ranges X to Y of Z (with pagination)".
    The issue is that if I click NEXT of Previous, the region is closing (hidding).. and in order to see the next / previous page of my report I have to re-open it..
    Is there any known workaround for this?
    Thank you in advance
    Anca

    I would start at Re: Toggle all hide show regions on a page open/closed
    It references the using javascript to manipulate your hide/show regions. It should get you started in the right direction. It is about the most straight-forward example I have seen for what you are trying to do<br><br>
    You could trigger the javascript after your page is rendered by calling it from the page footer and reference the values of page items to determine if you are supposed to hide the region(s).<br>
    Create a page item called P88_HIDESHOW_REGION1 and set it's value to Y or N depending on whether the #REQUEST# has a string in it that is part of report pagination. If you hover over a "next page" button in a report, check out the resulting URL that pops up in your browser.....it looks like ..../f?p=900:210:8352027355600111016:pg_R_241403738845262873:NO&pg_min_row=31&pg_max_rows=30&pg_rows_fetched=30
    <br>
    You could do an instr(:REQUEST,'pg_R_') > 0 then set P88_HIDESHOW_REGION1 = 'Y' else P88_HIDESHOW_REGION1 = 'N'. Your javascript called at the footer of the page could set the display of the region to on or off depending on the result of P88_HIDESHOW_REGION1

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Mantain state of hide show region

    hi to all,
    have someone been able to modify hide / show region to mantain state?
    This would be a great and if nobody has found a way,
    this would be really nice to have in next apex release.
    thanx

    Here is something to start with,
    If you check the Hide and show template in 4.0 (the classnames might be slightly different depending on your theme)
    &lt;table class=&quot;t5HideandShowRegion&quot; id=&quot;#REGION_ID#&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; summary=&quot;&quot;&gt;
    &lt;tr&gt;&lt;td class=&quot;t5RegionHeader&quot;&gt;#TITLE#&lt;a style=&quot;margin-left:5px;&quot; href=&quot;javascript:hideShow('region#REGION_SEQUENCE_ID#','shIMG#REGION_SEQUENCE_ID#','#IMAGE_PREFIX#themes/theme_5/rollup_plus_dgray.gif','#IMAGE_PREFIX#themes/theme_5/rollup_minus_dgray.gif');&quot; class=&quot;htmldbHideShowMinLink&quot;&gt;&lt;img src=&quot;#IMAGE_PREFIX#themes/theme_5/rollup_plus_dgray.gif&quot; <br/> id=&quot;shIMG#REGION_SEQUENCE_ID#&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td nowrap=&quot;nowrap&quot;&gt;&lt;div class=&quot;t5Hide&quot; id=&quot;region#REGION_SEQUENCE_ID#&quot;&gt;&lt;div class=&quot;t5ButtonHolder&quot;&gt;#CLOSE#&lt;img src=&quot;#IMAGE_PREFIX#themes/theme_5/1px_trans.gif&quot; height=&quot;1&quot; width=&quot;15&quot; alt=&quot;&quot;/&gt;#PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##HELP#&lt;/div&gt;&lt;div class=&quot;t5RegionBody&quot;&gt;#BODY#&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
    You can try changing the image references in the hideShow( function call to you plus and minus imgs. For the blue background color, you ll probably need to add an additional class to the RegionBody( t5RegionBody here) and add it to the page style.

  • Default Hide/Show Region to open

    I have a hide show region on page 0 that I want to sometimes default to opened (based on page item value). I added the code below to the region header of my hide show region. Worked fine, but now on all my pages that have Interactive Reports on them, clicking the drop-down arrow on the wheel throws an error 'gReport.controls is null or not an object'. Any ideas on how to get this to work on all pages?
    <script type="text/javascript">
    function showRegion(){
    //alert($x('P0_ALERT_REGION_VIEW').value);
    if ($x('P0_ALERT_REGION_VIEW').value == 'O')
    hideShow('region5');
    window.onload=showRegion;
    </script>

    I must be missing something.
    I gave the region a static ID of 'P0_ALERT_REGION' in the Region Defination section.
    Ran the page and looked for 'hideshow' (see below).
    Went into the Regio Header section and added:
    <script type="text/javascript">
    function showRegion(){
    //alert($x('P0_ALERT_REGION_VIEW').value);
    if ($x('P0_ALERT_REGION_VIEW').value == 'O')
    hideShow('region5','shIMG5','/i/themes/theme_10/showhide_hidden.gif');
    </script>
    When I open the page, region is still closed.
    <td class="t10RegionTitle"><span style="color: red;font-weight:bold"> Alerts (4 Found) </span><a class="eLink" title="Edit: &lt;span style=&quot;color: red;font-weight:bold&quot;&gt; Alerts (4 Found) &lt;/span&gt;" href="javascript:popupURL('f?p=4000:374:8668261332909072::::P374_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:9391908537586204,20080618,104');"><img src="/i/e.gif" alt="Edit" class="eLink" /></a><a style="margin-left:5px;" href="javascript:hideShow('region5','shIMG5','/i/themes/theme_10/showhide_hidden.gif','/i/themes/theme_10/showhide_show.gif');" class="htmldbHideShowMinLink"><img src="/i/themes/theme_10/showhide_hidden.gif"

  • How is a JQuery Vertical Accordian Different Than A Hide-Show Region

    Hello Everyone.
    I an using Apex 4.0.1. I recently learned how to create a JQuery vertical accordian. I'm using the sample accordian that Patrick Wolf recently created/posted. It uses a really nice "accordian template" that he put together. It's really quite useful when it comes to saving space and all on a page.
    Then I began wondering: How is this accordian different than Apex's own builtin Hide-Show Region template?
    And so, I created a sample page on my workspace in apex.oracle.com. I placed a JQuery vertical accordian that consists of 3 regions: 2 reports and a chart. I added a little bit of JQuery to Patrick's template that causes all 3 accordian slices to be closed as opposed to the default behavior of having one slice always open. I also added code that allows a user to re-size the entire accordian either vertically and/or horizontally.
    I then created 3 additional regions that mimic the first 3 regions above. These I placed in "column 2" on the page. For each region I assigned the "Hide-Show" template.
    As far as I can tell, both the accordian and the Hide-Show regions provide the same functionality.
    For the interested, here is a link to my page:
    http://apex.oracle.com/pls/apex/f?p=49919
    The app has open authentication assigned, and so, no login credentials are needed. Please click the "Accordian" tab.
    I realize that the accordian has more flexibilty in that one may add features like choosing to collapse/not collapse all slices and re-sizing, etc. I suppose one could do similarly for the Hide-Show regions using Javascript or JQuery but it would likely be an effort.
    Admittedly, such added features are cool and all. Still, it's been my experience that in the majority of business-like production environments, such "cool" features are pretty much useless. For example, I do not see how re-sizing the accordian or Hide-Show regions has much purpose. In fact, such "cool" features often get in the way of the main goal of the application.
    Of course, a JQuery accordian may also be created that expands/contracts slices "horizontally". I do not know of any way to do the same thing using Hide-Show regions. If someone does know how to do this, I (and likely others) would sure appreciate you sharing how.
    So, then, with respect to basic functionality (saving page real estate by encapsulating several regions), how is a JQuery vertical accordian any different than Apex's own builtin "Hide-Show" region?
    Thank you all for your thoughts/adice/code.
    Elie

    Hello Jari.
    Thank you for your help.
    Yes. Now I do understand what it is you are doing in your accordian page. And also I want to thsnk you for providing the sample code on your page showing how to go about preserving the current state of the accordian when you navigate from/to the page.
    You commented that this kind of state preservation is not available with the Hide/Show region. I'm thinking that you are correct, though I think I once saw something about doing this posted in this Forum. I'll search through and see if I can locate it.
    In any case, have you (or anyone else reading this thread) any other differences between a JQuery vertical accordian and Apex's own Hide/Show region? Other than being able to apply Javascript to an accordian to do things like preserve it's state (like you did), what else may one do with an accordian that is not doable (or at least not easily doable) with a Hide/Show region?
    Thank you for any further advice.
    Elie

  • 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

  • How do I keep Hide / Show Region open

    Hi,
    I have a page with one region based on a hide/show template. The current behaviour on a page submit is that the region always hides.
    I'd like it so that if the user opens the region that it will remain open after the page refreshes.
    Thanks,
    Brian

    This is a hack so I wouldn't count on it, but it worked for me (in variation, I needed a bit different thing). And, remind you, it only holds one of them open for a page (my logic is, that when they are hidden no more than one should be open at once).
    1) the page should have an item that holds the information - I'll call it OPEN_REGION. I am knowingly ignoring the usual Pn_ naming convention so all pages with Hide / Show regions could have their own OPEN_REGION but the name could still be uniquely referenced in javascript. It should be a hidden variable in the topmost region in the template (which must not be one of those enhanced HIde/Show regions).
    2) make a new javascript function to set the item and submit page. Be careful to make sure you use valid variables or javascript errors display when no OPEN_REGION item is on the page (for example).
    function myHideShow ( region )
    if (document.getElementById('OPEN_REGION'))
    if ( document.getElementById('OPEN_REGION').value != region )
    document.getElementById('OPEN_REGION').value = region;
    }else{
    document.getElementById('OPEN_REGION').value = '';
    doSubmit();
    2) edit the region template. Set it to call your own function.
    Where it sais:
    href="javascript:hideShow('region#REGION_SEQUENCE_ID#','shIMG#REGION_SEQUENCE_ID#','#IMAGE_PREFIX#jtfuhide.gif','#IMAGE_PREFIX#jtfushow.gif');"
    make it (set the page item to the region sequence number):
    href="javascript:myHideShow('#REGION_SEQUENCE_ID#');"
    3) edit your page template, in the footer add the opening of the region. Be careful to make sure you use valid variables or javascript errors display when no OPEN_REGION item is on the page (for example).
    <script>
    if (document.getElementById('OPEN_REGION'))
    if (document.getElementById('OPEN_REGION').value != '')
    theRegion = document.getElementById('OPEN_REGION').value;
    hideShow('region'+theRegion, 'shIMG'+theRegion, '#IMAGE_PREFIX#jtfuhide.gif', '#IMAGE_PREFIX#jtfushow.gif');
    </script>
    That should do it, but be aware, that I am not in Oracle team, just a simple programmer trying to find my own solutions and Javascript has helped me here sometimes.
    For example, try to use #TITLE# substitution string in BODY part of the Page Template...

  • Making hide/show survive a page refresh

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:251
    The Yes/No radiogroup options show/hide the next item row containing the text field.
    But suppose I select No to hide the text field item row and click Submit, when the page refreshes, the text field is visible again.
    What is the most generic way to make this kind of hide/show stuff "survive" a page refresh? Keeping in mind that I have a dozen such items on the page, so I wouldn't want to hardcode item names and stuff in my Javascript.
    Carl? Anyone else?
    Thanks

    I put the following code in the Region Footer
    <script type="text/javascript">
    function foo()
    var r=html_RadioValue('P251_X1');
    if (r==false) return true;
    if (r=='Yes') html_ShowItemRow('P251_X2');
    else          {
       html_GetElement('P251_X2').value='N/A';
       html_HideItemRow('P251_X2');
    return true;
    window.onload=foo();
    </script>And a onChange="foo()" in the HTML Form Element attributes for the P251_X1 item. Works like a champ.
    I was missing the window.onload part.
    Carl, if there is a better/recommended way to do this stuff, please let us know.
    Thanks.

  • Hide/Show cfgrid

    Is there any way to show a hidden cfgrid based
    on an OnChange event from another cfgrid? I've tried using
    a javascript function call.
    <!--- First grid excerpt  --->...
    bind="cfc:ATC._cfc.GetRCPsForFTEs.GetFTEs({cfgridpage},
           {cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{RCPs4FTEs.RCP_ID})"
          onChange="javascript:toggleEdit(EditTog)">
    <!--- 2nd grid excerpt  --->
    <!--- hide/show grid  --->
    <script language="JavaScript">
    function ChangeGrid(obj) {
       if (document.getElementById(obj).style.display == ")
       {document.getElementById(obj).style.display = 'none';}
       else
       {document.getElementById(obj).style.display = ";}
       alert("function ran");
    </script>
    If not,
    any suggestions on how I could show the hidden
    cfgrid from another cfgrid by some other method?
    Thanks

    Sorry. My previous post was incomplete.
    This should be the full message:
    Is There any way to show a hidden cfgrid based on an OnChange event from another cfgrid?
    I tried using a javascript function:
    <!--- show/hide cfgrid  --->
    <script language="JavaScript">
    function ToggleEdit(obj) {
       if (document.getElementById(obj).style.display == ")
       {document.getElementById(obj).style.display = 'none';}
       else
       {document.getElementById(obj).style.display = ";}
    </script>
    <!--- 1st grid excerpt  --->
    bind="cfc:ATC._cfc.GetRCPsForFTEs.GetFTEs({cfgridpage},
           {cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{RCPs4FTEs.RCP_ID})"
          onChange="javascript:toggleEdit(EditTog)">
    <!--- 2nd grid excerpt  --->
    <div id="EditTog" style="display:none">
       <cfform  name="FTE_EDIT">
       <!--- 7/12/10 Update an FTE chosen from the 2nd grid.  --->
    <!---                 values="#ValueList(qChosenFTE.Cat_Name)#"
                  valuesdisplay="#ValueList(qChosenFTE.Cat_Name)#" --->
           <cfgrid name= "FTE_EDIT"
    Any suggestions on what might work?
    Thanks.

  • Sticky Hide/Show example

    I downloaded the sample code for Sticky Hide Show regions. In general, I understand the concept and how things are supposed to work. I read the step-by-step instructions and am now stuck on the second half of step four.
    The step 4 instructions read:
    <i>"When the application you are now viewing was installed, the proper javascript was uploaded into #WORKSPACE_IMAGES# and can now be used by any application in this workspace. If you want to use this functionality in other workspaces, the apex_show_hide_region.js should be moved onto the file system and then linked appropriately."</i>
    I want to use this functionality in another workspace and in another database. But, I have almost no exerience with javascript and I don't understand what this statement means: <i><b>"the apex_show_hide_region.js should be moved onto the file system and then linked appropriately."</i></b>
    Could someone spell that out in simple terms for me? I would greatly appreciate the help.
    Thanks, Todd

    Hello,
    What it's saying is if you have access to the webservers filesystem (ftp / webdav / shared folders) it's usually better to put the javascript there instead of uploading it up into the WORKSPACE_IMAGES repository.
    Lets say you do have access and you create a directory under the images directory "custom_js" and upload the "apex_show_hide_region.js" to it then you would rewrite the link to
    <script src="#IMAGE_PREFIX#custom_js/apex_show_hide_region.js" type="text/javascript"></script>
    Regards,
    Carl

  • Problem in Hide/Show in a Table Row

    Hi,
    i have to create 4 pages and each page has a table region with displaying records and a column "LINK" to go to the next page with the parameters from that record. Every link has a batchId and one another Id as parameter to next page. The next page reads the parameters and queries the corresponding table for details of that results table region contained in that page.
    Thus i have 4 pages with 4 table regions and each table region is associated with a view object which is based on an EO connected with a database table. (4 VO's).
    Now in every table i have a detail region (hide/show) which shows error records for a row ....
    thus there are 4 ViewLinks for all 4 VO to a single ERROR VO.
    I have 4 instances of ERRORVO in AM like ERRORVO1, ERRORVO2, ERRORVO3, ERRORVO4.
    Now, the hide/show region is working properly on the first 3 pages with proper navigation to pages.
    Then, i created the 4th page and created the table region in the 4th page.
    From the 3rd page i have passed 2 parameters through the link and also retainAM=Y.
    i have captured both parametres and call a method to populate data in table of 4th page.
    Successfully done..running properly....
    Now i added the detail region which is a table as previous pages in the 4th page with ERRORVO4...
    Then when i run the page i get the 1st page and thrugh link i move to 2nd and to 3rd page. But when i click on the link on 3rd page to move to 4th page i m getting "NullPointerException" with "check Inner table properties"
    Now i removed the detail region (Hide/show) only from the 4th page and again run the page . its working properly for all 4 pages with proper navigation but i am not able to see errors with hide/show on 4th page and it is required.
    i m not getting what could be the reason...
    do i need to remove retainAM=Y from the page navigation links.?????
    and is there anything like we cant create more no. of instances (4) of a single VO in an AM.....????
    Any alternative for showing the errors on 4th page with Hide/Show or without Hide/Show????

    Thiago,
    Thanks for the quick reply.
    I am now getting the following error below:
    Am I suppose to add another field to my VO select?
    oracle.apps.fnd.framework.OAException: Detail View Attribute Name is not set for the table even though a detail named child has been specified. Please specify a Boolean or String ("Y" or "N") view attribute for this table property.
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1146)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1794)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)

  • How can I print my PDF to show Javascript?

    I've made a few forms for my work, and I'd like to print them and put them into a portfolio to take to future job interviews and yearly reviews. I'm trying to avoid having to take screenshots and paste them together, but if that's what I have to do, I can. Is there a feature in LC that will allow me to print my PDFs like this?
    Example:
    A portion of the page I designed is on the left with text boxes, etc. shown, and to the right is the code that is affected by the text field it points to.

    Hi,
    I guess this is not possible to do by just showing JavaScript. You can show these things in a JavaScript debugger always but while printing seems not possible. How about making a hidden Text/TextField and put some conditions/directions on how the fields should be filled up and making this Text/TextField visible at the time of printing? Because if someone does not know JavaScript and he needs to access it he will be confused. Makes sense??
    Thanks,
    Bibhu.

Maybe you are looking for