PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to highlight current field

  1. daveporter
    Member

    I'm getting to grips with GF, so apologies if this is obvious
    (I've searched the forms and docs with no obvious answer jumping out at me !)

    How do I style a form so the field that the cursor is in is highlighted with a border ?
    (commonly seen in many forms)

    Something like this - but not necessarily the whole area being highlighted !
    http://css-tricks.com/improved-current-field-highlighting-in-forms/

    TIA, Dave

    Posted 12 years ago on Sunday January 15, 2012 | Permalink
  2. You should be able to just add something like this to your theme's stylesheet:

    [css]
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=text]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=email]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=tel]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=url]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=number]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield input[type=password]:focus,
    body .gform_wrapper .gform_body .gform_fields .gfield select:focus {
    	border: 1px solid #00f;
    }

    You can obviously change the border px size and color to whatever you see fit.

    Posted 12 years ago on Sunday January 15, 2012 | Permalink