Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old November 14th, 2003, 07:44 AM
asim0s asim0s is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: nicosia,cyprus
Posts: 48 asim0s User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 31 sec
Reputation Power: 2
Send a message via ICQ to asim0s Send a message via Yahoo to asim0s
how can i treat a form as an array??

ok guys i have a form that has lots of elements on it
selection boxes,check boxes,input boxes.

i have this specific
<select name"race" onChange="selectrace()">
</select>

and my function is selectrace is a huge function that make lots of other select boxes from disabled to enabled and so on

my problem is that i keep adding select boxes, so i want to find a way that dynnamically it will find all selectboxes that there substring(6,8)==something to turn them on and off

here is an image to get an idea

http://www.mu-saga.com/calculators/ss.gif

Reply With Quote
  #2  
Old November 14th, 2003, 12:07 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: how can i treat a form as an array??

function disable_form1() {
for ( var i=0; i<document.form1.elements.length; i++ ) {

if(document.form1.elements[i].disabled==true){
document.form1.elements[i].disabled=false
}else{
document.form1.elements[i].disabled=true
}
}
}
// -->
</script>

all you need to do is add an IF statement around the existing if statement that evaluates the name to see if it matches the criteria you specified. This will allow you to turn the combo boxes off and on

Reply With Quote
  #3  
Old November 14th, 2003, 01:25 PM
asim0s asim0s is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: nicosia,cyprus
Posts: 48 asim0s User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 31 sec
Reputation Power: 2
Send a message via ICQ to asim0s Send a message via Yahoo to asim0s
RE: how can i treat a form as an array??

man you are a LIFE SAVIOUR

just cleaned around 200 lines of uneeded code
thx a million

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > how can i treat a form as an array??


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