Thanks, except I’m validating for numbers with decimar places too. What do I add to prevent it from automatically removing the decimal point every time I enter an illegal character (i.e. a letter)
Thanks,
Graham.
Just add decimal point to regexp mask
function checkNumbersOnly(val) {
if (val < 48 || val > 57 ){
alert(‘PLEASE NOTE: You can only type numbers in this field’);
z1.setComboText(z1.getComboText().toString().replace(/[^0-9.]+/g,""))
}
}
or
function checkNumbersOnly(val) {
if (val < 48 || val > 57 ){
alert(‘PLEASE NOTE: You can only type numbers in this field’);
z1.setComboText(parseFloat(z1.getComboText()))
}
}