Hello,
I add a javascript check to each input field. I use an onBlur event. But I
want to add a "batch check" function to a onSubmit event too. In case of
onBlur the call my check like this:
onBlur="isValid Int(this,'Error text',false)
But how can I call in case of onSubmit. There I can't use the "this" and the
following code doesn't work:
isValidInt(docu ment.ageField,' Error text', false);
....
function isValidInt(user Input, errorMsg, isReq){
var mask=/^\d+$/;
if (isReq == false && userInput.value == "") return true;
if (mask.test(user Input.value)) return true;
return false;
}
Thanks!
I add a javascript check to each input field. I use an onBlur event. But I
want to add a "batch check" function to a onSubmit event too. In case of
onBlur the call my check like this:
onBlur="isValid Int(this,'Error text',false)
But how can I call in case of onSubmit. There I can't use the "this" and the
following code doesn't work:
isValidInt(docu ment.ageField,' Error text', false);
....
function isValidInt(user Input, errorMsg, isReq){
var mask=/^\d+$/;
if (isReq == false && userInput.value == "") return true;
if (mask.test(user Input.value)) return true;
return false;
}
Thanks!
Comment