• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

stupid onsubmit question

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">&nbsp; Item ID: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     <%=result %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></p>
<p>

<font size=4 face="Helvitica"><font color="#000080">Bidder ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </font>&nbsp&nbsp; <INPUT TYPE="TEXT" NAME="BidderID" size="20"></font></p>
<p>

<font size=4 face="Helvitica">
  <font color="#000080">Bidder Password:&nbsp;&nbsp;&nbsp; </font>&nbsp<INPUT TYPE="PASSWORD" NAME="BidderPassword" size="20"><BR><BR>
  <font color="#000080">Bidding Price:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>&nbsp<INPUT TYPE="TEXT" NAME="BiddingPrice" size="20"><BR><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="SUBMIT" NAME="SubmitBid" VALUE="Submit Bid">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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
 
looks like your last return statement in doSubmit() is causing the problem.

I'm fairly sure that
return;

would be the same as
return false;

The onSubmit would therefore not succeed and you would continue to see the same page.
 
Back
Top