Quantcast
Channel: Tutorials Archives | Gravity Wiz
Viewing all articles
Browse latest Browse all 122

How to Style Gravity Forms Read-Only Fields

$
0
0

Set Field as Read-Only

Before any of this styling can be applied, we first need to actually set the field as read-only. You can do this with Javascript (like so) or you can use our GP Read Only plugin which let’s you set all applicable fields as read-only with the click of a button.

gp-read-only-settingsGP Read Only Settings

Targeting Desired Fields

You can style most field types with the the following CSS selector. Drop down, Checkboxes and Radio Button fields require slightly different selectors.

Most Fields

View this code snippet on GitHub.

Drop Downs

View this code snippet on GitHub.

Checkboxes & Radio Buttons

View this code snippet on GitHub.

Checkbox & Radio Button Labels

View this code snippet on GitHub.

Textareas

View this code snippet on GitHub.

Styling the Fields

These examples are based on the Most Fields example above. Just change the selector to apply them to Drop Downs, Checkboxes or Radio Buttons. These styles would go in your theme’s style.css file.

Change Font Color
Make the field value appear to be grayed out.

View this code snippet on GitHub.

Change the Cursor
Change the cursor to indicate that the field is not editable.

View this code snippet on GitHub.

Hide the “Input”
Give the appearance that the text is not actually being displayed within an input. View the demo for a visual example.

View this code snippet on GitHub.

Combining Multiple Styles

View this code snippet on GitHub.

Viewing all articles
Browse latest Browse all 122

Latest Images

Trending Articles



Latest Images