D
david
Hi,
I have 2 text boxes on an ASP form.
A user enters a Serial Number in TB1 such as 0105123456, presses tab to
move to TB2, TB2 then displays the value of TB1 after a calculation has
been done.
(Based on a Serial Number range).
i.e. a user enters 0105123456, TB2 then adds 'x' qty to this number
depending on how many serial numbers are required.
Code as folows:
_________________________________
<script type="text/javascript">
var squantity = <%= request.querystring("Quantity") %>;
function doCalc(x,y){
y.value = x.value==0?0:1*x.value + (squantity - 1);
}
</script>
_________________________________
On the code for TB1, I have the following:
TB2 has the name 'txtLastSerial'
onblur="doCalc(this,this.form.txtLastSerial)"
_________________________________
THE PROBLEM:
If a user enters their 10 digit serial number, the first 4 digita are
month and year, (mmyy), i.e. 0105 123 456, then TB2 displays the
correct result but WITHOUT THE LEADING ZERO ?
How can I correct my code to leave the leading zero ?
Appreciate your help
David.
I have 2 text boxes on an ASP form.
A user enters a Serial Number in TB1 such as 0105123456, presses tab to
move to TB2, TB2 then displays the value of TB1 after a calculation has
been done.
(Based on a Serial Number range).
i.e. a user enters 0105123456, TB2 then adds 'x' qty to this number
depending on how many serial numbers are required.
Code as folows:
_________________________________
<script type="text/javascript">
var squantity = <%= request.querystring("Quantity") %>;
function doCalc(x,y){
y.value = x.value==0?0:1*x.value + (squantity - 1);
}
</script>
_________________________________
On the code for TB1, I have the following:
TB2 has the name 'txtLastSerial'
onblur="doCalc(this,this.form.txtLastSerial)"
_________________________________
THE PROBLEM:
If a user enters their 10 digit serial number, the first 4 digita are
month and year, (mmyy), i.e. 0105 123 456, then TB2 displays the
correct result but WITHOUT THE LEADING ZERO ?
How can I correct my code to leave the leading zero ?
Appreciate your help
David.