How to Adding Autocomplete support to MARC21 Catalogue in koha | Book Data Entry page

Adding auto-complete feature to Koha’s MARC21 biblioitems field (Imprint – place, name of publisher, ISBN,edition, etc) as a cataloging aid.

Step - 1

Go to : Koha administration/Global system preferences/Staff interface/IntranetUserJS

Below the Java script  enable of the auto completed in four columns for ISBN, Place of publication, Name of the Publisher, Edition

Copy and paste the bellow JS Coding.


//**Autocomplete support to MARC21 catalogue**//  
$(document).ready(function(){
$( '[id^="tag_260_subfield_a"]' ).autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/cgi-bin/koha/cataloguing/ysearch.pl",
        dataType: "json",
        data: {
          term: request.term,
          table: "biblioitems",
          field: "place"
        },
        success: function(data) {
          response( $.map( data, function( item ) {
            return {
              label: item.fieldvalue,
              value: item.fieldvalue
            };
          }));
        }
      });
    },
    minLength: 1,
  });

 $( '[id^="tag_020_subfield_a"]' ).autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/cgi-bin/koha/cataloguing/ysearch.pl",
        dataType: "json",
        data: {
          term: request.term,
          table: "biblioitems",
          field: "ISBN"
        },
        success: function(data) {
          response( $.map( data, function( item ) {
            return {
              label: item.fieldvalue,
              value: item.fieldvalue
            };
          }));
        }
      });
    },
    minLength: 1,
  });
  
  $( '[id^="tag_260_subfield_b"]' ).autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/cgi-bin/koha/cataloguing/ysearch.pl",
        dataType: "json",
        data: {
          term: request.term,
          table: "biblioitems",
          field: "publishercode"
        },
        success: function(data) {
          response( $.map( data, function( item ) {
            return {
              label: item.fieldvalue,
              value: item.fieldvalue
            };
          }));
        }
      });
    },
    minLength: 1,
  });

 $( '[id^="tag_250_subfield_a"]' ).autocomplete({
    source: function(request, response) {
      $.ajax({
        url: "/cgi-bin/koha/cataloguing/ysearch.pl",
        dataType: "json",
        data: {
          term: request.term,
          table: "biblioitems",
          field: "Editionstatement"
        },
        success: function(data) {
          response( $.map( data, function( item ) {
            return {
              label: item.fieldvalue,
              value: item.fieldvalue
            };
          }));
        }
      });
    },
    minLength: 1,
  });
});

Click Save Button.

Step - 2

Go to : Home/Cataloging/New Record (Enter the all bibliographies details )


References:

[1] http://www.loc.gov/catworkshop/RDA%20training%20materials/LC%20RDA%20Training/Module1IntroManifestItemsSept12.doc

[2] https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started

[3] https://gist.github.com/l2c2technologies/7d0449dcb80c90880381ef4571003d1d

[4] http://catb.org/jargon/html/H/hack.html

[5] http://blog.l2c2.co.in/index.php/2017/01/15/adding-autocomplete-support-to-marc21-260-264-imprint-fields-in-koha/

Post a Comment

14 Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. https://techubber.blogspot.com/?m=1

    ReplyDelete
  3. H, i need to do that for a title. I edited to get the titles but got no response. can you help me?
    $( '[id^="tag_245_subfield_a"]' ).autocomplete({
    source: function(request, response) {
    $.ajax({
    url: "/cgi-bin/koha/cataloguing/ysearch.pl",
    dataType: "json",
    data: {
    term: request.term,
    table: "biblioitems",
    field: "title"
    },
    success: function(data) {
    response( $.map( data, function( item ) {
    return {
    label: item.fieldvalue,
    value: item.fieldvalue
    };
    }));
    }
    });
    },
    minLength: 1,
    });

    ReplyDelete
    Replies
    1. Sry, Title and Authors filed not working in autocomplete options.

      Delete
  4. Very Informative and creative contents. This concept is a good way to enhance the knowledge. thanks for sharing.
    Continue to share your knowledge through articles like these, and keep posting more blogs.
    And more Information Online Doctor Consultation App

    ReplyDelete
  5. Such a nice article I read all your blogs because I get some knowledge. Keep it up! I am would like to suggest my blog How Long Does iOs 15 Take To Install?.

    ReplyDelete
  6. Such a informative article fabulous ! thanks for sharing this. I would like to share my blog how to fix the last line no longer available error on iPhone.

    ReplyDelete
  7. Sorry, Title and Authors filed not working in autocomplete options. I would like to share my blog about how to fix the last line no longer available error on iPhone.

    ReplyDelete
  8. Hello. I followed the instructions but can't find results. Does it work with Koha 23.05?

    ReplyDelete
  9. How would be the JS code to use the output of any report (`...koha/svc/report`) which output is a single column? For eg `SELECT DISTINCT seriestitle FROM biblio ORDER BY seriestitle;`, to get the autocomplete on 490$a.

    ReplyDelete