Where to place JS code to be used by Admin? I have a simple requirement that I want to implement JS on couple of fields. Through JS, I want to hide few fields by default and show them when a checkbox is clicked.

The problem is where to keep this JS for admin. Below is the JS which is working. Weirdly, when I paste in the console of Chrome, the JS then works.

JS

jQuery('input#edit-field-mine-und').change(function() {
        if(jQuery(this).is(":checked")) {
            alert("Checked");
        }
        else {
            alert ("Not Checked");
        }
        //$('#textbox1').val($(this).is(':checked'));        
});


Any help where I can place this JS so that it can be used in admin drupal pages?
You have to put that either in an administrative theme or in a custom module.

It's a good idea generally to have a child theme based on the administrative theme you are already using.
This means that you can override most of the things (e.g. styles, labels, etc.) in the admin while still being able to update the parent theme.

Here's how you would do it if you are using Seven for example:


Create a new folder named seven_custom
Inside create a new file named seven_custom.info and copy all the regions from seven.info file
Copy the screenshot.png and logo.png from Seven
Create a new file named custom.js for example
Add that file under scripts[] in seven_custom.info, like so:

scripts[] = custom.js

Edit your JS file to extend Drupal behaviors and use Drupal.t() for making strings translatable:

(function ($) {
  Drupal.behaviors.UltimaTheme = {
    attach: function (context, settings) {
      $('input#edit-field-mine-und').change(function() {
        if($(this).is(':checked')) {
          alert(Drupal.t('Checked'));
        }
        else {
          alert(Drupal.t('Not Checked'));
        }
      });
    };
  };
})(jQuery);



I wrote this without testing, but should work fine. Let me know if it doesn't.