How to change the background color

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

sudjain
Ebase User
Posts: 8
Joined: Fri Jul 24, 2009 4:02 am

How to change the background color

#1

Postby sudjain » Tue Sep 15, 2009 3:47 pm

Please let me know how to change the background color of single text box in the form . How do i add a class to the textbox and refer in the css.My form has multiple text boxes.
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Re: How to change the background color

#2

Postby AJDulk » Thu Sep 17, 2009 8:00 am

While I have not tried it, you could try to use FPL to set a highlight style for the element you wish to control. The highlight style needs to be defined in your Presentation Template. The highlight style adds a class to the selected element - open up the source of the page when viewing in the web browser and search the html to find it. Use this class to zoom in on your specific text box that you wish to style using CSS.

I am using this in our forms to style buttons, so I am pretty sure it will also work for a text box. To date, the class always remains the same for the highlight style - this means you can use the same css to change other text boxes using FPL without having to check which class will be assigned.
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#3

Postby Wai » Fri Sep 18, 2009 9:40 am

Alternatively, as this is an editable field, Ebase will have given the text field an ID.

It's possible to find the ID by looking at the HTML source of the form. You can then apply the CSS to the ID.
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Re: How to change the background color

#4

Postby AJDulk » Fri Sep 18, 2009 11:57 am

Wai wrote:Alternatively, as this is an editable field, Ebase will have given the text field an ID.

It's possible to find the ID by looking at the HTML source of the form. You can then apply the CSS to the ID.
Okay, there are 2 disadvantages of this:
1. The ID is not unique through the whole system. If you use the same CSS for all forms then you may have fields changing colour in the other forms where you do not want them to.
2. The Ebase generated ID is not static, if you add fields to the page there are cases where the ID changes. You would need to sync your CSS and your Form every time you change something in the form or risk the wrong field changing colour.
0 x


Who is online

Users browsing this forum: No registered users and 108 guests