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.

Customising required field asterix

  1. sascha
    Member

    Hi there,
    I would like to customise the way that the required fields asterix is being displayed. I'm thinking off either:
    1. Using my own graphic/png/jpg
    2. Using a different standard sign or string (i.e # or <required>)
    3. Just styling the input field different (i.e making the border red and 5px thick)
    4. Any other creative way that I/you can come up with

    Is there a hook I can use?

    Posted 10 years ago on Wednesday November 30, 2011 | Permalink
  2. sascha
    Member

    As an interim solution I used some CSS on the gfield_required, but unfortunately the css I applied kicks out the alignment of the form, when used in 2 3 4 columns. Have a look at:
    http://landwire.de/add-event/

    The CSS I applied it as follows:

    .gfield_required {
        font-size: 40px;
        left: 5px;
        position: relative;
        top: 17px;
    }

    Is there a way to fix that?
    I would much rather prefer to use my own string or ideally change the look of the input field (as described above). Maybe there is some fancy CSS targetting that I could do (like choose only next select after gfield_required)? I am crap at targeting CSS though. Any ideas?

    Posted 10 years ago on Wednesday November 30, 2011 | Permalink
  3. This would allow you to select the inputs that are required:

    [css]
    .gfield_contains_required input, .gfield_contains_required textarea, .gfield_contains_required select {
    border: 2px solid blue;
    }

    Then you could always do a display: none on the .gfield_required if you didn't want that to show.

    Posted 10 years ago on Wednesday November 30, 2011 | Permalink
  4. sascha
    Member

    Hey Rob,
    many thanks! Did not see that class before at all...
    Also solved the alignment problem from code above by adding a line-height attribute!

    Posted 10 years ago on Wednesday November 30, 2011 | Permalink
  5. Right on!

    Posted 10 years ago on Wednesday November 30, 2011 | Permalink

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