• Hi,
    I am trying to Highlight: “This is a required field” on a google form. (I am using Google form plugin)

    I tried to add in custom CSS:

    div.errorbox-bad div.ss-item-required label {
    color: red;
    }

    But it doesn’t work.

    I managed to find a way around when I had an empty required text by inspecting the element “This is a required field”

    Here what I had:
    <label id="entry_797821070-error" class="error-message" for="entry_797821070">This field is required.</label>

    I just wrote in Custom CSS:

    #entry_797821070-error{
      color: red;
    }

    No Problem!

    Here when it doesn’t work:
    If I have a multiple choice question, when I inspect element on “This is a required field”
    Here what I have:

    <label id=”entry.1129847272-error” class=”error-message” for=”entry.1129847272″>This field is required.</label>

    Because of the “.” in entry.1129847272-error, The custom CSS doesn’t work.

    Any idea how I can solve that?

    Thanks.

    Bruno (I am new in using wordpress and CSS)

Viewing 3 replies - 1 through 3 (of 3 total)
  • In html if you want to make a field required you would use the keyword required in the element.
    Example

    <input type='text' required>

    You can use the pattern attribute to define a pattern to use when completing the field. Example

    <input type='text' pattern="[0-9]{3}-[0-9]{3}-[0-9]{3}">

    would set a pattern to match a phone number. It would only except a pattern matching a phone number. Some patterns are predefined in html5

    example
    <input type='email' >

    would only except a valid email address.

    If you don’t want to use html predefined patterns you can use a javascript program .

    Thread Starter Brunounours

    (@brunounours)

    Hi, thanks for your answer.

    I do already have the field required since the message: “this is a field required” Appear when it is needed. (must be codded through the plugin)

    I want to have this message appearing in red.

    When I inspect the element of the text I want in red :

    <label id=”entry.1129847272-error” class=”error-message” for=”entry.1129847272″>This field is required.</label>

    I want to change “entry.1129847272-error” in red

    I tried in custom CSS:

    #entry.1129847272-error{
      color: red;
    }

    But it doesn’t work because of the “.”

    Any idea how to solve this?
    Thanks

    Thread Starter Brunounours

    (@brunounours)

    Still stuck, Anyone has any clue? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Highlight Google form pluggin required field’ is closed to new replies.