N
NotGiven
I have a field called telephone whose ONBLUR action is to call a javascript
function:
validatePhoneNumber(telephone)
The non-working function is:
function validatePhoneNumber(v)
{
var phone =document.form. + v + .value; //HERE"S WHAT IS
NOT WORKING
var stripped = phone.replace(/[\(\)\.\-\ ]/g, '');
.........//code left out for clarity
document.form. + v + .focus()
}
I want to reuse the function so I need to make it generic. Any ideas?
Many thanks.
function:
validatePhoneNumber(telephone)
The non-working function is:
function validatePhoneNumber(v)
{
var phone =document.form. + v + .value; //HERE"S WHAT IS
NOT WORKING
var stripped = phone.replace(/[\(\)\.\-\ ]/g, '');
.........//code left out for clarity
document.form. + v + .focus()
}
I want to reuse the function so I need to make it generic. Any ideas?
Many thanks.