HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 25th, 2003, 08:39 AM
dizzle dizzle is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 44 dizzle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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?

Reply With Quote
  #2  
Old December 3rd, 2003, 02:53 AM
dev257 dev257 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Chandigarh
Posts: 55 dev257 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 48 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old January 8th, 2004, 01:06 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
what kind of limitations are you placing on the dynamically created text fields?

Reply With Quote
  #4  
Old January 8th, 2004, 01:30 AM
dev257 dev257 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Chandigarh
Posts: 55 dev257 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 48 sec
Reputation Power: 5
no limitation as far as they are in a form and you know their names

Reply With Quote
  #5  
Old January 8th, 2004, 02:24 PM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
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?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > dynamic form validation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT