Suggestion: add class "required" to required fields on add listing

This topic contains 9 replies, has 4 voices, and was last updated by  Directory Path 4 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #491823

    Directory Path
    Expired Member
    Post count: 235

    Please add a class to required label and form fields so we can style them using CSS. Any class name would do as long as it’s consistent for all required fields.

    #491904

    Kor
    Moderator
    Post count: 16516

    Hi there,

    Thanks for your post. You can add CSS class to your fields following the instructions here https://wpgeodirectory.com/docs-v2/places/custom/#fields . Could you tell us what are you trying to do with the required label? Are you trying to change it to an image or something else?

    #491907

    Directory Path
    Expired Member
    Post count: 235

    Hi Kor.
    We are trying to style <input>s and <label>s that are required in the add listing form. Adding CSS classes to custom fields don’t work, because they don’t appear in the source code of the add listing form.

    #491964

    Alex Rollin
    Moderator
    Post count: 27815

    I have made a note of your request, thanks

    #492041

    Paolo
    Site Admin
    Post count: 31206

    There is no need to add classes to labels, because they are ALL wrapped in a unique DIV. Same for input that in addition all have both an ID and a Class.

    If you don’t know how to do something with CSS, it’d be nicer to ask, rather than telling us to add something that is NOT needed.

    Example of CSS for Title label:

    #post_title_row label {
        color: red;
    }

    Thanks

    #492051

    Directory Path
    Expired Member
    Post count: 235

    Thanks Paolo. We thought it would be easier for everyone to style all required elements at once and not individually.

    We’ll prefix all suggestions with “Suggestion:” to make it clearer because “please add a class to required label and form fields” is not “telling us to add something that is NOT needed”.
    Thanks again.

    #492053

    Paolo
    Site Admin
    Post count: 31206

    Style all label:

    .geodir_form_row label {
    /* css here */ }

    Style all input:

    .geodir_form_row input {
    /* css here */ }

    If you don’t know how to do something with CSS, it’d be nicer to ask, rather than asking please to add something that is NOT needed.

    Thanks again

    #492056

    Directory Path
    Expired Member
    Post count: 235

    That styles all labels and input, Paolo, not just the required ones as mentioned.

    If you can’t understand the suggestion is only about *required fields*, it’d be nicer to ask, rather than keep saying I am suggesting things that are NOT needed.

    Thanks.

    #492058

    Paolo
    Site Admin
    Post count: 31206

    Ops sorry I missed that part, but STILL…

    Change style of required field labels only:

    .required_field.geodir_form_row label {
    /* css here */ }
    
    Change style of required field input only:
    
    .required_field.geodir_form_row input {
    /* css here */ }

    If you don’t know how to do things…

    #492063

    Directory Path
    Expired Member
    Post count: 235

    Thank you, Paolo. I didn’t realize there was already a required class attribute, but at the row level, that’s why I suggested one to be created and put “Suggestion:” in the topic’s subject.
    Thanks again.

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket