Hi There,
I’m performing some validation functions on a form I’ve created.
For the phone number, I have 3 text boxes lined up next to one another. The first is for the country code, the second is for area code and the third is for the remainder of the phone number.
I have used the following in order to detect whether the input value isNaN.
[CODE]
input = document.getElementById(“phone1”);
if (isNaN(input.value)) {
errorText += “n – Your phone number cannot be text.”;
}
if (!valid)
alert(errorText);
return valid;
}
As I have three text boxes for the phone number, can I group them within this one statement? So, …getElementById(“phone1, phone2, phone3”); ?
If not, what would you recommend?
Thanks for your time and help!