Sign Up

Hey, Dev!
Are you looking for a forum full of active developers to help you?
So if you want to:
➡️ Get answers for your development issues
➡️ Help others
➡️ Write an article
➡️ Get rewarded for your active participation
Then this place is just for you and it is 100% FREE.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo

OrclQA.Com Navigation

  • Ask Question
  • Write a Tutorial
  • Online Courses
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • Image to Base64
  • PL/SQL Beautifier
  • Ask Question
  • Write a Tutorial
  • Online Courses
Naren
Naren

Naren

  • 5 Questions
  • 5 Answers
  • 0 Best Answers
  • 49 Points
View Profile
  • 1
NarenContributor
Asked: September 28, 20212021-09-28T07:57:56+05:30 2021-09-28T07:57:56+05:30

Highlight Oracle Apex focus item label (Set Style)

  • 1

Hi I have a requirement to highlight the selected item or focused item label when there is a huge gap between the label and input box in a horizontal line bar items.

I would like to mix both css styles, otherwise i have to write code for each item such as on focus or lost focus. Please find sample css code below.

.apex-item-select:focus, .apex-item-text:focus, .apex-item-textarea:focus {
background-color:#EFEAFC!important;
border-color:#926BFA!important;
}
.t-Form-label { font-weight:bold; font-size:11.5px; font-family: sans-serif; color:#132436;
text-transform: capiralize; /* Make text all uppercase */
}

apexcssoracle
  • 5
  • 319
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
Answer

    5 Answers

    1. Vinish

      Vinish

      • 1 Question
      • 847 Answers
      • 74 Best Answers
      • 4k Points
      View Profile
      Best Answer
      Vinish Enlightened
      2021-09-28T11:30:22+05:30Added an answer on September 28, 2021 at 11:30 am

      Try the below jQuery code. Put this code in the Execute When Page load section, and this highlight the label with yellow color on focus:

      $('input').on('focus', function() {
      $("#"+this.id+"_LABEL").css("background-color", "yellow");
      }).on('blur', function() {
      $("#"+this.id+"_LABEL").css("background-color", "white");
      });
      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
    2. Naren

      Naren

      • 5 Questions
      • 5 Answers
      • 0 Best Answers
      • 49 Points
      View Profile
      Naren Contributor
      2021-09-28T17:51:46+05:30Added an answer on September 28, 2021 at 5:51 pm

      Was struggling to find this beautiful code from more than a week. It is working as expected and big million thanks to you Vinish.

      • 1
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
    3. Naren

      Naren

      • 5 Questions
      • 5 Answers
      • 0 Best Answers
      • 49 Points
      View Profile
      Naren Contributor
      2021-09-28T21:59:14+05:30Added an answer on September 28, 2021 at 9:59 pm
      This answer was edited.

      Hi Vinish,

      One last check on this requirement. If I want to highlight the next column "value" even though that item is Read Only, Is it possible?

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
    4. Naren

      Naren

      • 5 Questions
      • 5 Answers
      • 0 Best Answers
      • 49 Points
      View Profile
      Naren Contributor
      2021-09-29T08:12:31+05:30Added an answer on September 29, 2021 at 8:12 am

      I am using the below code, but somehow it is returning an error. In my case next item value is read only which needs to be highlighted.

      $('input').on('focus', function() {
           var self = $(this)
           , form = self.parents('form:eq(0)')
           , focusable
           , next       ;
           focusable = form.find('readOnly').filter(':readonly');
           next = focusable.eq(focusable.index(this)+1);
      $("#"+next.id).css("background-color", "#e2dcf5");
      }).on('blur', function() {
      $("#"+next.id).css("background-color", "white");
      });

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
    5. Vinish

      Vinish

      • 1 Question
      • 847 Answers
      • 74 Best Answers
      • 4k Points
      View Profile
      Vinish Enlightened
      2021-09-29T08:39:05+05:30Added an answer on September 29, 2021 at 8:39 am

      I think you will have to put some if conditions to determine the current item and the next. Below is an example:

      $('input').on('focus', function() {
      $("#"+this.id+"_LABEL").css("background-color", "yellow");
      if (this.id == "P1_YOURITEM") { 
         // then you know what is the next item
         $("#P1_READONLYITEM"+"_LABEL").css("background-color", "yellow");  
      }
      }).on('blur', function() {
      $("#"+this.id+"_LABEL").css("background-color", "white");
      $("#P1_READONLYITEM"+"_LABEL").css("background-color", "white"); 
      });
      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask Question
    Write a Tutorial

    Recent Blog Posts

    • Vinish

      What is Oracle ERP?

    • Vinish

      The Benefits of Unit Testing

    • Vinish

      Java OOPS Concepts MCQ Quiz

    • Vinish

      What is the Best Database to Use?

    • Vinish

      Sending Query Strings in Post Requests in C#

    Explore

    • Home
    • Blog
    • New Questions
    • Tutorials
      • Oracle
      • Oracle Apex
      • Python
    • Tags
    • Users
    • Badges & Points
    • Image to Base64
    • PL/SQL Beautifier

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    © 2021 OrclQA.Com. All Rights Reserved.
    Privacy Policy - About Us