...

View Full Version : how to check the current value and the previous value



tllcll
10-24-2005, 06:47 AM
Hi,

I would like to know how to check the current value and the previous value entered by user before changes.

for example, the form will allow user to enter customer number. The first time user enter 10 then change to 22

customer number : 10 -> change to 22

how do I get the previous value which is 10 in this case

Philip M
10-24-2005, 08:48 AM
var firstAttempt = 0; // or 999999999999 if you prefer
var secondAttempt = 0;
var customerNumber; // the number input by the customer
if (customerNumber != firstAttempt) {
secondAttempt = firstAttempt;
firstAttempt=customerNumber;
}

secondAttempt contains the previous (different) number entered.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum