Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Applying styles to text boxes

Aritra KarJul 5 2016 — edited Jul 6 2016

How to style the background color of text boxes in Oracle Apex version 5.0?

Comments

AdamJaws

This will depend on what you are attempting to achieve.

Simple way would be to use the theme roller, however this will apply to all.

Mahmoud_Rabie

Hi Aritra

Solution

1) Create a text box called P1_TESTTB

2) Create On-Load Page Dynamic Action. In its True Action, executes the following JavaScript

$('#P1_TESTTB').css('background-color','red');

/*also you could change the CSS styles of other text boxes in your page here*/

Please check this demo that I have created for you

https://apex.oracle.com/pls/apex/f?p=55160

test/test

I hope that solves your problem

Regards

Mahmoud

PabloBocchio-Oracle

Hi Aritra,

If you are using the "Universal Theme - 101" a way to change the background color is editing the page template and adding this text in the css inline section:

.t-Form-fieldContainer .t-Form-inputContainer input.text_field, .t-Form-fieldContainer .t-Form-inputContainer input[type=text]{

    background-color: #E464E4;

}

I adding .t-Form-fieldContainer in the declaration of the inputs. These lines only applies to input fields with type = text or has the class .text_field.

Textareas or inputs with other classes and types do not be affected but you can add them adding the appropriate selector:

.t-Form-fieldContainer.t-Form-inputContainer input.text_field, .t-Form-fieldContainer .t-Form-inputContainer input[type=text], .t-Form-fieldContainer .t-Form-inputContainer input[type=number], .t-Form-fieldContainer .t-Form-inputContainer input.my_class{

    background-color: #E464E4;

}

I hope this answer could help you

Regards

Pablo

Aritra Kar

I am executing the javascript under true action where the selection type is the JavaScript Expression and I am including the statement given above, but its not working.

Aritra Kar

Its working but as I want to make the background color transparent, it is also removing the border lines of the text container.

Pavel_p

Hi Aritra,

please, install the packaged application Sample Dynamic Actions and go to Style=>Add/Remove class (focus) and edit any row. You can see there how to apply/remove style properly.

Regards,

Pavel

1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 3 2016
Added on Jul 5 2016
6 comments
4,532 views