Results 1 to 3 of 3

Thread: Dropdown Field Default Value

  1. #1
    Thread Starter
    jpicarth's Avatar
    Join Date
    Apr 2013
    Location
    Spain
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dropdown Field Default Value

    Is there a hook of filter to set default selected value for dropdown field?
    I see the $post_meta_val does not have anything to modify:
    PHP Code:
    $post_meta_val = ( $post ) ? get_post_meta($post->ID$result->field_nametrue) : false
    and the 'cp_formbuilder_' does not pass the current option name in the loop:

    PHP Code:
    foreach ( $options as $option ) {
        
    $args = array( 'value' => $option );
        if ( 
    $option == $post_meta_val )
            
    $args['selected'] = 'selected';
        
    $args apply_filters'cp_formbuilder_' $result->field_name '_option'$args$result$post );
        
    $html_options .= html'option'$args$option );

    Any idea on how to set default value for dropdown list could be great.
    Thank You.

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  3. #3
    serno's Avatar
    Join Date
    Apr 2013
    Location
    Denmark
    Posts
    31
    Thanks
    22
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: June 1st, 2013, 12:56 AM
  2. change current dropdown style to default
    By sgnetz in forum ClassiPress General Discussion
    Replies: 4
    Last Post: August 13th, 2011, 02:58 AM
  3. change current dropdown style to default
    By sgnetz in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: August 11th, 2011, 08:57 AM
  4. Default permalink displays when selecting from dropdown
    By gibbere in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: May 14th, 2011, 02:10 AM