Harry_Hardcore
Gawd
- Joined
- Oct 11, 2001
- Messages
- 581
Code:
<script>
function emptyField(textObj)
{
if(textObj.value.length == 0) return true;
for(var i=0; i<textObj.value.length;i++) {
ch = textObj.value.charAt(i);
if(ch != ' ' && ch != '\t') return false;
}
return true;
}
function doSubmit(thisForm)
{
if (emptyField(thisForm.BidderID)
{
alert("Please choose a \"Bidder ID\" !");
return false;
}
if (emptyField(thisForm.BidderPassword))
{
alert("Please enter a \"Password\" !");
return false;
}
if (emptyField(thisForm.BiddingPrice))
{
alert("Please enter a \"BiddingPrice\" !");
return false;
}
return;
}
</script>
<form name="SubmitBidForm" action="submitBid.jsp"
onSubmit="return doSubmit(this);" method="post">
<blockquote>
<p><font color="#000080" size="4" face="Helvitica"> Item ID: <%=result %> </font></p>
<p>
<font size=4 face="Helvitica"><font color="#000080">Bidder ID:
</font>  <INPUT TYPE="TEXT" NAME="BidderID" size="20"></font></p>
<p>
<font size=4 face="Helvitica">
<font color="#000080">Bidder Password: </font> <INPUT TYPE="PASSWORD" NAME="BidderPassword" size="20"><BR><BR>
<font color="#000080">Bidding Price: </font> <INPUT TYPE="TEXT" NAME="BiddingPrice" size="20"><BR><BR>
<INPUT TYPE="SUBMIT" NAME="SubmitBid" VALUE="Submit Bid">
</font>
</p>
</blockquote>
<input type="hidden" name="ItemID" value="<%=result %>">
</form>
i had this working, but somehow it got changed and i cant figure out why the onsubmit doesnt work? it just loads the page..
any help will be much appreciated