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.

Custom Styling Question

  1. Christinarule
    Member

    I'm having some issues figuring out this css. I've added CSS Class Name to some of my forms fields so I could put in a custom input bg. I put the css in the "forms.css" When reading some of the forum post I saw that some people were adding the css to their theme's css. Which is correct? Also if I want to change other things about the form for example, the space between each input box, fonts, headers etc how do I go about calling that out in css with out changing the rest of my forms? Is their a unique ID each form is given? My goal is to tune this form http://christinarule.com/wordpress/contact/ into something like my design http://www.christinarule.com/form.png

    thanks in advance!

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  2. We recommend putting any custom css rules in your theme stylesheet or theme's custom.css file if it has one. If you put it in the default forms.css file in the plugin folder, it will be overwritten when you auto update and you'll be pretty unhappy.

    Yes, every form has a unique ID so you can target fields based on inheritance from that ID. for example:

    #gform_wrapper_1 input[type=text} {background-color:#f00; color:#fff}

    the "_1" would be your form ID.

    You can refer to this visual guide to get a better idea of how the forms are structured and how the classes and ID's are applied.

    http://www.gravityhelp.com/documentation/visual-css-guide/

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  3. Christinarule
    Member

    Kevin!!!! Thank you! Amazing support!!! Thanks!!! I'll try it out!

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  4. Sure. Just let us know if you need anything else.

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  5. Christinarule
    Member

    okay so im getting stuck... instead of the text being above the field I want it to be on the side, so in front of the field. I'm trying to call out the label but nothing is happening. My form ID is 1 so wouldn't this be what I'd call out .gfield_label_1

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  6. Christinarule
    Member

    AH never mind just realized I didnt include #gform_1 SORRy

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  7. Christinarule
    Member

    okay stuck again

    #gform_1 .gform_wrapper .gform_footer {
    margin-bottom:0;
    margin-left:0;
    margin-right:0;
    margin-top:1px;
    padding-bottom:10px;
    padding-left:0;
    padding-right:0;
    padding-top:6px;
    }

    shouldnt that call out the footer??

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  8. If you want left aligned labels instead of top aligned labels then you can do this by changing a form setting. Edit your form to access the form builder, hover over the Form Title area and click the Edit to open up the form settings. One of the options is label placement. You can choose top or left aligned labels.

    This should fine for changing the label position. CSS isn't required for this.

    One thing to note is some WooThemes have hardcoded CSS to force the label position. So if you are using a WooTheme and the label placement option isn't working, this is why.

    It's hard to tell what CSS is correct without being able to see the form on your site and inspecting the HTML.

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  9. Christinarule
    Member

    Thanks Carl!

    Is there a way to change the error message? "There was a problem with your submission.
    Errors have been highlighted below "

    Also if you go to my page http://christinarule.com/wordpress/ and hit the submit button when the error pops up it takes away the button??

    Posted 14 years ago on Friday October 22, 2010 | Permalink
  10. You've constrained the height on your #gform_wrapper_1 to 375px and it already has an "overflow:hidden" applied to the class. That means when the validation error shows, the bottom part of the form is pushed below the visible area. You can try this instead.

    #gform_wrapper_1 {
      background-color:#F1EEEE;
      border:3px solid #FFFFFF;
      min-height:375px;
      padding-top:2px;
      overflow:visible
    }

    You can change the validation message by adding this filter to your theme's functions.php file.

    <?php
    // custom validation message for form id 1
    add_filter("gform_validation_message_1", "change_message_1", 10, 2);
    function change_message_1($message, $form){
      return "<div class=\"validation_error\">Oops. Something isn't right. Please make sure the values in the highlighted fields are correct & try submitting again.</div>";
    }
    ?>
    Posted 14 years ago on Friday October 22, 2010 | Permalink
  11. Thanks for this!

    Shouldn't this text string be able to be set as an option on the form set up?

    Posted 13 years ago on Wednesday February 23, 2011 | Permalink
  12. @gbotica This is a default error message. We can look at adding it as a form setting in the future, although it was originally designed to be a translatable string so it is part of the localization when the plugin is translated into other languages via PO files.

    Posted 13 years ago on Wednesday February 23, 2011 | Permalink

This topic has been resolved and has been closed to new replies.