Is there a way to toggle a custom metabox based on a custom drop down selection for a custom post type?

What I mean is I would like my custom post “proposal” to display different metaboxes based on a selection. For example, I select Print from a drop down and it will display all my custom fields that are assigned to Print. When I select Website I would like to display different fields that are assigned to Website. When each field is selected I would like the previous selected field to hide. Each selection will display a few fields.

To display my custom post type

 $args = array(
      'labels'              =>  array(
      'name'                => __( 'Proposal Overview'),
      'singular_name'       => __( 'Proposal'),
      'add_new'             => __( 'Add New Proposal'),
      'add_new_item'        => __( 'Add New Proposal'),
      'edit_item'           => __( 'Edit Proposal'),
      'new_item'            => __( 'New Proposal'),
      'all_items'           => __( 'All Proposal'),
      'view_item'           => __( 'View Proposal'),
      'search_items'        => __( 'Search Proposal'),
      'not_found'           => __( 'No Proposal found'),
      'not_found_in_trash'  => __( 'No Proposal found in Trash'),
      'hierarchical'        => true,
      'parent_item_colon'   => '',
      'all_items'           => __('Proposal')
           ),
      'supports'                => array( 'title','revisions','comments','author','editor' ),
                'show_in_menu'          => 'edit.php?post_type=client_portal',
                'public'                => true,
        );      
        register_post_type( 'Proposal', $args );    

Read more here: Toggle a metabox based on a selection


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , ,

Wordpress related questions and answers: