|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
JS: Loop through TextBoxes
Hey everyone,
There was a similiar question answered on the forum, but I couldn't quite use it for what I need done. I have some textboxes: shire1, shire2, shire3, ... And I want to create a string of their values: for (i = 1; i <= amount; i++) { SendTo = 'shire' + i; alert(document.frm.SendTo.value); SendToString += '; ' + document.frm.SendTo.value; } I thought I used similar code before but for some reason it is saying "Sendto.value" is not an object. What am I doing wrong? Thanks! |
|
#2
|
||||
|
||||
|
SendTo is a string, not the object you want.
Use eval('document.frm.shire' + i + '.value') or better have a look at getElementById() |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JS: Loop through TextBoxes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|