getting textfield value
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sami_Radzinski
Posted On:   Sunday, December 8, 2002 03:14 PM

Can anyone teach me how to retrieve the value of a textfield whose name is dynamically created? as my webpage is built dynamically, the number of textfields will then be determined by the number of times the 'add textfield' button is clicked by the user. I will then assign each name with a number behind e.g txt1,txt2,txt3 etc.... However when i try to retrieve the value of the textfield using this: for(var x=1; x alert(document.form1.txt+x.value); } It always return me 'NaN'. i check the value of txt+x as a string and it is correct returning me txt1,txt2 etc... correctly. Can anyone help me please? thanks so m   More>>

Can anyone teach me how to retrieve the value of a textfield whose name is dynamically created?


as my webpage is built dynamically, the number of textfields will then be determined by the number of times the 'add textfield' button is clicked by the user.


I will then assign each name with a number behind e.g txt1,txt2,txt3 etc....


However when i try to retrieve the value of the textfield using this:


for(var x=1; x

alert(document.form1.txt+x.value);

}


It always return me 'NaN'. i check the value of txt+x as a string and it is correct returning me txt1,txt2 etc... correctly.


Can anyone help me please? thanks so much!

   <<Less

Re: getting textfield value

Posted By:   Jeanne_Boyarsky  
Posted On:   Sunday, December 8, 2002 03:54 PM

About | Sitemap | Contact