You'll need to store the old value manually. You could store it a lot of different ways. You could use a javascript object to store values for each textbox, or you could use a hidden field (I wouldn't recommend it - too html heavy), or you could use an expando property on the textbox itself, like this:
<input type="text" onfocus="this.oldvalue = this.value;" onchange="onChangeTest(this);this.oldvalue = this.value;" />
Then your javascript function to handle the change looks like this:
<script type="text/javascript">
function onChangeTest(textbox) {
alert("Value is " + textbox.value + "
" + "Old Value is " + textbox.oldvalue);
}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…