-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaceBid.js
59 lines (52 loc) · 1.28 KB
/
placeBid.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
57
58
59
var xHRObject = false;
if(window.XMLHttpRequest)
xHRObject = new XMLHttpRequest();
else if(window.ActiveXObject)
xHRObject = new ActiveXObject("Microsoft.XMLHTTP");
//Function to validate the bidding price
function fnValidateBid()
{
var Bid = document.getElementById('txtPBDollar').value+"."+document.getElementById('txtPBCent').value;
if(isNaN(parseFloat(Bid)))
{
alert("Please enter numeric value");
return false;
}
else
{
cbValue = document.getElementById('CBPid').value;
if(parseFloat(Bid) <= parseFloat(cbValue))
{
alert("Please place higher bid than current bid");
return false;
}
else
{
//var ItemNumber = document.getElementById('INid').value;
//fnProcessBid(ItemNumber,Bid);
return true;
}
}
}
//Function to call a php and update the new bid
function fnProcessBid(ItemNumber,Bid)
{
//Load auction xml
var xmlDoc = loadXMLDoc();
alert(xmlDoc);
}
function loadXMLDoc()
{
var xmlFile = "../../data/auction.xml";
xHRObject.open("GET",xmlFile,false);
xHRObject.onreadystatechange = function()
{
if (xHRObject.readyState == 4 && xHRObject.status == 200)
{
return xHRObject.responseText;
//document.getElementById("result").innerHTML = htmlResponse;
//alert(xmlDoc);
}
}
xHRObject.send(null);
}