@@ -, +, @@ creating a subscription --- koha-tmpl/intranet-tmpl/prog/js/subscription-add.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js +++ a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js @@ -52,12 +52,25 @@ function Check_page1() { return false; } } - if ($("#biblionumber").val().length == 0) { + + var biblionumber = $("#biblionumber").val() + if ( biblionumber.length == 0 ) { alert( MSG_LINK_BIBLIO ); return false; } - return true; + var bib_exists; + $.ajax({ + url: '/cgi-bin/koha/svc/bib/' + biblionumber, + async: false, + } + ).done( + function(){ bib_exists = true; } + ).fail ( + function(){ alert(_("Bibliographic record does not exist!")); bib_exists = false; } + ); + + return bib_exists; } function Check_page2(){ --