The issue that I'm having, is that when I click the submit button, the only thing that shows in the history window is only one line with the time stamp only. The time stamp is over written if I input additional bids. The bidID and bidAmount does not show and the bidAmount is not showing in the highBid field.
Thanks in advance for any assistance with this, I'm feeling quite lost.
<title>Auction Log</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var bids = new Array();
var bidders = new Array();
var bidTime = new Array();
function writeBid() {
var historyText = "";
for (var i = 0; i < bids.length; i++) {
historyText = bidTime[i] + bids[i] + bidders[i] + "\n";
document.bidForm.bidList.value = historyText;
document.bidForm.highBid.value = bidAmount[i];
document.bidForm.bidId.value = " ";
document.bidForm.bidAmount.value = " ";
}
}
function addBid() {
bidders.unshift("");
bids.unshift("");
var now = new Date ();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
minutes = minutes < 10 ? "0"+minutes : minutes;
seconds = seconds < 10 ? "0"+seconds : seconds;
var timeText = hours + ":" + minutes + ":" + seconds;
bidTime.unshift(timeText);
writeBid();
}
function removeBid() {
bids.shift(bids(0));
bidders.shift(bidders(0));
bidTime.shift(bidTime(0));
writeBid();
}
</script>
</head>
<body>
<form name="bidForm" id="bidForm">
<div id="head">
<p>
<a href="#">Home</a> <a href="#">Auctions</a>
<a href="#">Features</a> <a href="#">Schedule</a>
<a href="#">Contacts</a>
</p>
<img src="logo.jpg" alt="Schmitt Auction Haus" /></div>
<div id="intro">
<h1>Silent Auction</h1>
<h2>Tawney Farm</h2>
<table id="summarytable" border="2">
<tr>
<th>Lot #121</th>
<td>TurfTuff Lawn Tractor X24 (2003)</td>
</tr>
<tr>
<th>Current High Bid</th>
<td>
<input id="highBid" name="highBid" readonly="readonly" />
</td>
</tr>
<tr>
<th>Bidding Ends</th>
<td>15:00</td>
</tr>
</table>
<table id="newbidtable" border="2">
<tr>
<th colspan="2" id="newtitle">Enter New Bid</th>
</tr>
<tr>
<th>Bidder ID</th>
<td>
<input id="bidId" name="bidId" />
</td>
</tr>
<tr>
<th>Bid Amount</th>
<td>
<input id="bidAmount" name="bidAmount" />
</td>
</tr>
<tr>
<th id="buttons" colspan="2">
<input type="button" value="Submit" onclick="addBid()" />
<input type="button" value="Remove Last Bid" onclick="removeBid" />
</th>
</tr>
</table>
</div>
<div id="bidHistory">
<h1>Bid History</h1>
<p>
<textarea id="bidList" name="bidList"></textarea>
</p>
</div>
<address>
Schmitt AuctionHaus ·
3401 Rural Route 4 ·
Fenbrook, IN 38012
</address>
</form>
</body>
</html>
This post has been edited by kadiya: 15 November 2009 - 03:54 PM

New Topic/Question
Reply



MultiQuote



|