From 62da1dbad921cc68cd6ba5d3a8f363f37dbf43d4 Mon Sep 17 00:00:00 2001 From: oleonard Date: Thu, 25 Aug 2005 16:36:00 +0000 Subject: [PATCH] Fix for bug 585 (Using 'document.forms[0]' notation prevents use of other forms on page) Changing the reference from [0] to ['f'], with 'f' being the form name, seems to work fine. --- .../default/en/acqui.simple/addbiblio.tmpl | 26 +++++++++---------- .../default/en/acqui.simple/additem.tmpl | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl index 56e85a377c..b2298f4ecd 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -491,28 +491,28 @@ function Check(f) { } alert(alertString2); } else { - document.forms[0].submit(); + document.forms['f'].submit(); } } function Dopop(link,i) { - defaultvalue=document.forms[0].field_value[i].value; + defaultvalue=document.forms['f'].field_value[i].value; newin=window.open(link+"&result="+defaultvalue,"value builder",'width=550,height=550,toolbar=false,scrollbars=yes'); } function PopupZ3950() { var strQuery=""; - for (i=0 ; i0) { - strQuery += "&isbn="+document.forms[0].field_value[i].value; + for (i=0 ; i0) { + strQuery += "&isbn="+document.forms['f'].field_value[i].value; } - if (document.forms[0].kohafield[i].value == "biblio.title" && document.forms[0].field_value[i].value.length>0) { - strQuery += "&title="+document.forms[0].field_value[i].value; + if (document.forms['f'].kohafield[i].value == "biblio.title" && document.forms['f'].field_value[i].value.length>0) { + strQuery += "&title="+document.forms['f'].field_value[i].value; } - if (document.forms[0].kohafield[i].value == "biblio.author" &&document.forms[0].field_value[i].value.length>0) { - strQuery += "&author="+document.forms[0].field_value[i].value; + if (document.forms['f'].kohafield[i].value == "biblio.author" &&document.forms['f'].field_value[i].value.length>0) { + strQuery += "&author="+document.forms['f'].field_value[i].value; } - if (document.forms[0].kohafield[i].value == "biblioitems.issn" && document.forms[0].field_value[i].value.length>0) { - strQuery += "&issn="+document.forms[0].field_value[i].value; + if (document.forms['f'].kohafield[i].value == "biblioitems.issn" && document.forms['f'].field_value[i].value.length>0) { + strQuery += "&issn="+document.forms['f'].field_value[i].value; } } newin=window.open("../z3950/search.pl?bibid="+strQuery,"z3950search",'width=800,height=400,toolbar=false,scrollbars=yes'); @@ -523,8 +523,8 @@ function Changefwk(FwkList) { } function AddField(field) { - document.forms[0].op.value = "addfield"; - document.forms[0].addfield_field.value=field; + document.forms['f'].op.value = "addfield"; + document.forms['f'].addfield_field.value=field; document.f.submit(); } diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl index 642cbf0b68..84adbe962f 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/additem.tmpl @@ -113,7 +113,7 @@ function Check(f) { } } function Dopop(link,i) { - defaultvalue=document.forms[0].field_value[i].value; + defaultvalue=document.forms['f'].field_value[i].value; newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes'); } function confirm_deletion(bibid,itemnum) { -- 2.39.5