|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
dynamic form validation
i am dynamically generating a form from a database. when the textboxes are written to the html i used a loop to increment one number so they are named txtBox1, txtBox2, etc. i am trying to come up with a way to run some javascript form validation and i want to dynamically loop through all text boxes because there could be different numbers of text boxes for different pages. i have done this with radio buttons, but i am not clear on how to do it with textboxes, does anyone have any suggestions?
|
|
#2
|
|||
|
|||
|
use formname.item.count for counting the elements
next loop through every textbox using for eg given below for(i=0;i<formname.item.count;i++) { alert(formname.item(i).value) } you will need some fine tuning of the given sample |
|
#3
|
||||
|
||||
|
what kind of limitations are you placing on the dynamically created text fields?
|
|
#4
|
|||
|
|||
|
no limitation as far as they are in a form and you know their names
|
|
#5
|
||||
|
||||
|
limitations in the sense that you are validating the text boxes. What do you want to validate them against? Do you simply want to make sure they're not empty?
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > dynamic form validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|