Hey all..
I have a form, and part of that form are some text widgets.. They are all given id's like phoneNumber1, phoneNumber2, etc..Upon page load, they are all given the type of "hidden".
I'm trying to access them with the following for loop:
function teamPopulate(field){
var number = field.value;
for(var i = 1; i >= number; i++){
document.getElementById('phoneNumber' + i).type="text";
}
}
However, I seem to have a syntax error in the 'phoneNumber' + i. If I substitute phoneNumer1 or phoneNumber2 it does work on those options.. So the concept would seem to be sound, at least to my mind. Any suggestions on how to use the 'phoneNumnber' + i?
Thanks
David
I have a form, and part of that form are some text widgets.. They are all given id's like phoneNumber1, phoneNumber2, etc..Upon page load, they are all given the type of "hidden".
I'm trying to access them with the following for loop:
function teamPopulate(field){
var number = field.value;
for(var i = 1; i >= number; i++){
document.getElementById('phoneNumber' + i).type="text";
}
}
However, I seem to have a syntax error in the 'phoneNumber' + i. If I substitute phoneNumer1 or phoneNumber2 it does work on those options.. So the concept would seem to be sound, at least to my mind. Any suggestions on how to use the 'phoneNumnber' + i?
Thanks
David