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:
  #1  
Old September 14th, 2003, 11:53 PM
s0ccarstud s0ccarstud is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Chicago, IL
Posts: 55 s0ccarstud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to s0ccarstud
Help

Is there anything wrong with this? The name of the form is correct. It seems to error when it hits the line
var numVids=d.elements[numOfVids].value;

Any help would be greatly appreciated.

function validateQuantity()
{
var d=document.order1;
var numVids=d.elements[numOfVids].value;
var i;
for(i=1;i<numVids;i++)
{
if(d.elements[quantity[i]].value>0)
{
break;
}
}
if(i==numVids)
{
alert("You must have a quantity of atleast 1");
return 1;
}
else
return 0;
}

Reply With Quote
  #2  
Old September 15th, 2003, 01:12 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Help

try

d.elements['numOfVids'].value

Reply With Quote
  #3  
Old September 15th, 2003, 01:57 AM
s0ccarstud s0ccarstud is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Chicago, IL
Posts: 55 s0ccarstud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to s0ccarstud
RE: Help

Thanks so much Zombie, that fixed that part of it.
Now the error is here

d.elements[quantity[i]].value>0

I can't figure out a way to quote it.

d.elements['quantity['i']'].value>0
won't work because it takes what is between the first 2 singles, and doubles won't work either...any suggestions?

Reply With Quote
  #4  
Old September 15th, 2003, 03:46 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Help

post the form html code please.

and while i wait, i will try to guess:

Code:
for(i=1;i<numVids;i++) {
    qi='quantity['+i+']';
    if (d.elements[qi].value>0) { 
        // ...


Reply With Quote
  #5  
Old September 15th, 2003, 07:43 AM
s0ccarstud s0ccarstud is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Chicago, IL
Posts: 55 s0ccarstud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to s0ccarstud
RE: Help

Zombie, you're a God send! Thanks so much, that last one worked!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Help


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