i am validating an input field and would like to clear the field if the user typed an invalid character.
function validateTotal(thevalue){
if(thevalue.length >= 1)
{
if (isNaN(thevalue) || thevalue <= 0) {
alert(thevalue + ' is not a valid number!');
}
}
}
-- my field names are dynamic. how do i reference this in the "validateTotal" function so i can clear the field?
<input type="Text" name="xyz#t#" size="10" value="#form.regiontotal#" onkeyup="validateTotal(this.value);">
thanks
ryan
function validateTotal(thevalue){
if(thevalue.length >= 1)
{
if (isNaN(thevalue) || thevalue <= 0) {
alert(thevalue + ' is not a valid number!');
}
}
}
-- my field names are dynamic. how do i reference this in the "validateTotal" function so i can clear the field?
<input type="Text" name="xyz#t#" size="10" value="#form.regiontotal#" onkeyup="validateTotal(this.value);">
thanks
ryan