-
Notifications
You must be signed in to change notification settings - Fork 11
/
validateproduct.js
56 lines (52 loc) · 1.22 KB
/
validateproduct.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function validate()
{
Item_ID=document.getElementById("Item_ID").value;
Item_Name=document.getElementById("Item_Name").value;
Price=document.getElementById("Price").value;
Stock_ID=document.getElementById("Stock_ID").value;
Quantity=document.getElementById("Quantity").value;
Threshold=document.getElementById("Threshold").value;
Barcode=document.getElementById("Barcode").value;
exp_date=document.getElementById("exp_date").value;
if(Item_ID == "")
{
alert("Please enter the Item Id.");
return false;
}
if(Item_Name == "")
{
alert("Please enter the Item name");
return false;
}
if(Price == "" || isNaN(Price))
{
alert("Please enter the price of the product");
return false;
}
if(Stock_ID == "")
{
alert("Please enter the stock id.");
return false;
}
if(Quantity == "" || isNaN(Quantity))
{
alert("Please enter the quantity");
return false;
}
if(Threshold == "" || isNaN(Threshold))
{
alert("Please enter the Threshold");
return false;
}
if(Barcode == "")
{
alert("Please enter the Barcode");
return false;
}
if(exp_date == "")
{
alert("Please enter the Expiry date of the item");
return false;
}
return true;
}