home *** CD-ROM | disk | FTP | other *** search
-
- var isIE = false;
- var comp = navigator.appName;
- if (comp.indexOf("Microsoft") >= 0) {
- isIE = true;
- }
-
- // test function for debugging internals
- function test()
- {
- var s = "";
-
- for(var i = 1; i <= parent.shop.orderNum; i++)
- s += parent.shop.orderList[i].anzahl + " x " + parent.shop.orderList[i].name + "\n";
-
- alert("DataBase Input:\n" + s);
- }
-
- function MyEval(form, str) {
- //alert(form.name +"."+ str);
- if (isIE) {
- return eval(form.name +"."+ str);
- }
- else {
- return form.eval(str);
- }
- }
-
- function ChangeTxt(form, form1) {
- var x, h;
-
- var str="quantity"; // as the edit box name
- var num=form.name.substring(str.length, form.name.length); // got the row number
-
- h = "num" + num + ".value"; // numX.value
- // num - MAX quantity of available items
- n = parseInt(MyEval(form1, h));
- nv = parseInt(form.value);
-
- if (form.value != "" && form.value != "0" && !isNaN(nv))
- {
- if (nv < 0) {
- alert("Negotive value!!!");
- form.value = 1;
- form.select();
- form.focus();
- return false;
- }
-
- if (nv > n) {
- message = "Die maximale Bestellmenge eines Artikels: " + n ;
- alert(message);
- form.value = MyEval(form1, h);
- form.select();
- form.focus();
- return false;
- }
-
- n = form.value;
-
- isbn = MyEval(form1, "isbn" + num + ".value");
- title = MyEval(form1, "title" + num + ".value");
- price = MyEval(form1, "price" + num + ".value");
- link = MyEval(form1, "link" + num + ".value");
- maxitem = MyEval(form1, "num" + num + ".value");
- index = MyEval(form1, "index" + num + ".value");
-
- parent.shop.addOrderElem(n, title, isbn, price, link, maxitem, index);
- }
- else {
- n=0;
- form.value = "";
- isbn = MyEval(form1, "isbn" + num + ".value");
- title = MyEval(form1, "title" + num + ".value");
- price = MyEval(form1, "price" + num + ".value");
- link = MyEval(form1, "link" + num + ".value");
- maxitem = MyEval(form1, "num" + num + ".value");
- index = MyEval(form1, "index" + num + ".value");
-
- parent.shop.addOrderElem(-n, title, isbn, price, link, maxitem, index);
- // remove this order string from list
-
- }
- return true;
- }
- // end of checks.js
-
-