Skip to main content
Post Reopened by fuxia
Post Closed as "Duplicate" by Wyck, s_ha_dum, brasofilo, fuxia
Removed unrelated content.
Source Link
brasofilo
  • 22.1k
  • 8
  • 69
  • 264

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
    $(function() {
        $('#page_template').change(function() {
            $('#postdivrich').toggle($(this).val() == 'page-child.php') ;
            $('#postdivrich').toggle($(this).val() == 'default') ;
        }).change() ;
    }) ;
})(jQuery) ;

Please help

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
    $(function() {
        $('#page_template').change(function() {
            $('#postdivrich').toggle($(this).val() == 'page-child.php') ;
            $('#postdivrich').toggle($(this).val() == 'default') ;
        }).change() ;
    }) ;
})(jQuery) ;

Please help

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
    $(function() {
        $('#page_template').change(function() {
            $('#postdivrich').toggle($(this).val() == 'page-child.php') ;
            $('#postdivrich').toggle($(this).val() == 'default') ;
        }).change() ;
    }) ;
})(jQuery) ;

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
    $(function() {
 
        $('#page_template').change(function() {
        
        $('#postdivrich').toggle($(this).val() == 'page-child.php'); ;
            $('#postdivrich').toggle($(this).val() == 'default') ;
        
     }).change() ;
 
    }) ;
})(jQuery) ;

Please help

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
$(function() {
 
    $('#page_template').change(function() {
        
        $('#postdivrich').toggle($(this).val() == 'page-child.php'); 
        $('#postdivrich').toggle($(this).val() == 'default');
        
     }).change();
 
});
})(jQuery);

Please help

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
    $(function() {
        $('#page_template').change(function() {
            $('#postdivrich').toggle($(this).val() == 'page-child.php') ;
            $('#postdivrich').toggle($(this).val() == 'default') ;
        }).change() ;
    }) ;
})(jQuery) ;

Please help

Source Link

JQuery multiple toggle values

I'm trying to hide/show metaboxes dependant on the page template chosen. This has been working fine until I have come to show a metabox on more than one chosen page template.

The below code displays the Rich Content Editor for default pages, but not page-child.php pages. I'm guessing I have written the code incorrectly:

(function($){
$(function() {

    $('#page_template').change(function() {
        
        $('#postdivrich').toggle($(this).val() == 'page-child.php'); 
        $('#postdivrich').toggle($(this).val() == 'default');
        
    }).change();

});
})(jQuery);

Please help