Blank non selectable field drop down

This topic contains 21 replies, has 3 voices, and was last updated by  Dotty Directory 7 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #229163

    Dotty Directory
    Full Member
    Post count: 254

    Ive added a field to the listing form with a drop down menu asking for a month, I’ve made this field required. It lists month’s from Jan to Dec.

    How do i add an initial *Placeholder* field which does not include as a result but has the text “Please select a month”, so that it still shows as *required* if this *Placeholder* field is still present. And that the user will have to select a month to continue.

    Thanks

    #229340

    Dotty Directory
    Full Member
    Post count: 254

    Also I cant find it anywhere, is there a hook function for when a listing is published.

    Its for a function add_action (‘NEEDPUBLISHHOOK’,’Update_User_Meta’)

    Cheers

    #229581

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    for the 1st question, I don’t think that is possible at all. For the second question I asked to the developers to let us know and they will asap.

    Thanks

    #229706

    Dotty Directory
    Full Member
    Post count: 254

    So i cannot select an initial *Please choose a month*? If not i understand.

    And thank you for passing the second question forward.

    Thanks

    #230146

    Paolo
    Site Admin
    Post count: 31206

    Not that I know of, but the developers will let us know about that too… Maybe there is a hook that could allow that.

    Thanks

    #230526

    Dotty Directory
    Full Member
    Post count: 254

    Okay thats great thanks for chasing that up for me Paolo

    #230530

    Kiran
    Moderator
    Post count: 7069

    Hi Dotty,

    For the first question just add “Please select a month/” in Admin -> GeoDirectory -> CPT(Place) Settings -> Custom Fields -> Your Field option values.
    So if you have already option values like “Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec” then new option value with placeholder will be “Please select a month/,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec”

    For the second question you can use the following hook function code.

    
    
    // Function to be executed when a CPT(custom post type) is published.
    function geodirectory_publish_gd_place( $post_ID, $post = array() ) {
        // do stuff here.
    }
    add_action( 'publish_gd_place', 'geodirectory_publish_gd_place', 10, 2 ); // Replace "gd_place" with your CPT(custom post type) name.

    Let us know.
    Thanks,
    Kiran

    #230548

    Dotty Directory
    Full Member
    Post count: 254
    This reply has been marked as private.
    #230552

    Dotty Directory
    Full Member
    Post count: 254
    This reply has been marked as private.
    #230554

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #230570

    Dotty Directory
    Full Member
    Post count: 254
    This reply has been marked as private.
    #230673

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #230684

    Dotty Directory
    Full Member
    Post count: 254
    This reply has been marked as private.
    #230685

    Dotty Directory
    Full Member
    Post count: 254
    This reply has been marked as private.
    #231133

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 22 total)

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

Open Support Ticket