[thelist] javascript comparison

Rob Smith rob.smith at THERMON.com
Wed Oct 29 11:20:36 CST 2003


My javascript test is testing supposedly numerical values as strings, when
they should be compared by actual value.

Javascript function:

if (bid.previousbid.value > bid.nextbid.value ) {
  alert("Please enter a bid greater than $" + bid.previousbid.value + ".");
  return false;
  } else {
  return true;

Form Data:

Initial Bid: <input type="hidden" name="previousbid"
Minimum Bid: <input name="nextbid" type="text"
value=<%=RS.fields.item("LatestBid").value+1%> size="4">

Sample test:

Initial Bid: $ 5
Minimum Bid: $ 10

Error Message

Please enter a bid greater than $5.
 (... I did.)

Is there a way I can cast values in javascript?


More information about the thelist mailing list