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.

border on click of field

  1. I have search but can not find a proper answer.

    I have my form done but I'd like to add some sex appeal. For starters I'd like to add CSS so that when each field is clicked on the border around it turns colour. For example, user clicks on the field named 'phone' and a blue highlighted glowing border would appear.

    Can someone point me in the right direction for this.

    Thanks
    site: http://vancouverrealestate.ca/find-a-real-estate-agent

    Posted 13 years ago on Tuesday November 29, 2011 | Permalink
  2. This should do the trick for you, just place it in your theme's style sheet. You can obviously add more styles to the declaration other than the border-color if you want.

    [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,
    body .gform_wrapper .gform_body .gform_fields .gfield textarea:focus {
    	border-color: #ff0;
    }
    Posted 13 years ago on Tuesday November 29, 2011 | Permalink
  3. Thanks Rob.
    I changed the colour to blue and see that the border is a thin solid line. How do I change it to have a glowing effect?

    See this effect on many forms where the container 'glows'. For lack of a better example see hotmail.com main login page. Is it a border radius I'd play with?

    thanks again.

    Posted 13 years ago on Tuesday November 29, 2011 | Permalink
  4. You'd want to use box-shadow, which is a CSS3 property (as is border-radius, but border-radius is what makes the input round.) Check out this tool for an easy-to-use configurator for styling with CSS3:

    http://css3generator.com/

    Posted 13 years ago on Tuesday November 29, 2011 | Permalink