From ec63f5d30650b6fe7d1e823bd041bb577ea878c1 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 28 Feb 2005 13:59:28 +0000 Subject: [PATCH] checking for mandatory & non mandatory fields in acquisition --- .../default/en/acqui/newbiblio.tmpl | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl index a7106cdd54..8aeb496eff 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl @@ -5,6 +5,9 @@ function update(f){ //collect values quantity=f.quantity.value + if (quantity ==0) { + alert("Quantity must be >0"); + } discount=f.discount.value listinc=parseInt(f.listinc.value) currency=f.currency.value @@ -32,20 +35,34 @@ function update(f){ f.ecost.value=ecost; f.GST.value=GST; f.total.value=total; - + return true; } function messenger(X,Y,etc){ -win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0"); -win.focus(); -win.document.close(); -win.document.write("


"); -win.document.write(etc); -win.document.write("

"); -win.document.write("
"); + win=window.open("","mess","height="+X+",width="+Y+",screenX=150,screenY=0"); + win.focus(); + win.document.close(); + win.document.write("


"); + win.document.write(etc); + win.document.write("

"); + win.document.write("
"); } + +function check(f) { + quantity=f.quantity.value + if (title == "") { + alert("Title can't be empty"); + return false; + } + if (quantity ==0) { + alert("Quantity must be >0"); + return false; + } + document.frusin.submit(); +} + //--> @@ -187,7 +204,7 @@ win.document.write(""); ">

- +