6 Replies Latest reply: Oct 7, 2013 3:32 AM by Ziut RSS

    how change colour of field?




      My worspace is:



      and parameters: jwozniak/jwozniak/jwozniak


      only one standard application and page 8 Product Availability.


      when I choose Available as No I would like to change colour of List Price field (from green to red) and disable this field.


      I've done:


      1. In HTML Header is javascript:


      <script type="text/javascript">


      function html_disableItem(nd,a){

         var lEl = document.getElementById(nd);

         if (lEl && lEl != false){


                 lEl.disabled = true;

                 lEl.style.background = '#882020';


                 lEl.disabled = false;

                 lEl.style.background = '#428820';



         return true;


      function disFormItems(){

      var lRadios = document.getElementById('P8_AVAILABLE').getElementsByTagName('INPUT');

      var lReturn;

      for(var i=0;i<lRadios.length;i++){

        if(lRadios[i].type.toUpperCase() == 'RADIO' && lRadios[i].checked){lReturn = lRadios[i].value;}


      var lTest = lReturn == 'N';





      2. for item P8_AVAILABLE in section Element in HTML Form Element Attributes is:




      3. In HTML Header in Display Attributes in field Cursor Focus is Do not focus cursor.


      4. In HTML Header in in Page HTML Body Attribute is:


      onload="disFormItems(); first_field();"


      This exercise was in previous version apex tutorial and it worked (maybe apex2 or 3 - I don't remember). But in Apex 4.2 - no.


      Question is where is error or how to do it in other way?


        • 1. Re: how change colour of field?



          Man what a drag! You had one typo in the definition of your radio button. It had a traling space "STATIC2:Yes;Y,No;N ", instead of "STATIC2:Yes;Y,No;N". Therefore the value of the 'No' button was "N " and never validates to true. I removed the space and your code works fine.


          One thing though, your code as it is, is a bit fragmented over page header, item field attributes etc. I've set up a dynamic action that can also handle the change of List Price. The dynamic action can bundle your code on a single place, which is nice from a maintenance point of view.

          The dynamic action has its condition set to 'Never', so it doesn't do anything at the moment. If you want to see it work, you can put the display condition to 'None'.




          • 2. Re: how change colour of field?

            Hi vdeelen

            You are right: Man what a drag!

            Thank you for your help.


            Could ypu tell me what should I do to see on the botton of screen tool bar: Home Application 12555 Edit Page 8 etc.

            On apex.oracle.com I see it but in my instalation - no. It depends on internet browser?

            • 3. Re: how change colour of field?



              To show the Developer Toolbar, you must ensure that:

              1) the 'Status' attribute under the 'Edit Application Definition' tab is set to 'Available with Edit Links'.

                  In Apex 4.2.x go to 'Shared Components'>'Globalizatoin Attributes'>'Definition' tab, then it's the first attribute undetr the 'Availability' section.

              2) you're logged in as developer in to the Application Builder in the same browser session.




              • 4. Re: how change colour of field?

                Hi Vincent


                Status is correct but it dosn't work.

                Look in my apex:


                and parameters: tb2/tb2/tb2




                • 5. Re: how change colour of field?

                  Hi Joseph,


                  So I see. Is your installation upgraded from an older version of ApEx? There is a known issue for that:

                  Oracle Application Express 4.2.2 - Known Issues



                  16769040 - DEVELOPER TOOLBAR IS MISSING AFTER UPGRADING TO 4.2.2

                  After upgrading to 4.2.2, the developer toolbar can be missing when running applications from within the Application Express builder environment.

                  Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.

                  Alternative Workaround: Run the following code logged in as SYS as SYSDBA -










                  • 6. Re: how change colour of field?


                    Thanks Vincent