|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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; } |
|
#2
|
|||
|
|||
|
RE: Help
try
d.elements['numOfVids'].value |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
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) {
// ...
|
|
#5
|
|||
|
|||
|
RE: Help
Zombie, you're a God send! Thanks so much, that last one worked!
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|