# maximum the receiver does not work

Hello,

maximum the receiver does not work

What could be the problem?
Could you help me?

[/php]

Thanks

Hello again,

The rule : The amount of products can be max 21(sample).

This JavaScript gives a warning about rule above for one value.

I want that;

The JavaScript must give a warning for total choosing values.

1. value=“5”
2. value=“10”
3. value=“8”
=23 are great than 21. (It must give a warning)

Thanks

I don’t know if I understand…

It looks like you are checking each value > maximum

``sayi[x].value><?=\$maximum_receiver?>``

Shouldn’t you be adding all values to see if the sum is > maximum?

Sample:
2. 16
4. 10
5. 12

Thank you very much

What I mean is… shouldn’t you have a loop to get the sum of all values?

e.g.

``````var i = 0;
for(x=0;x<marka.length;x++){
i = i + sayi[x].value;
}
}``````

m@tt, Thank you very much
Note: For amount:

[php]var i = 0;
for(x=0;x<marka.length;x++){
i = i + sayi[x].value;
}
}
[/php]
How can I add the following code into?
[php]

[/php]

Adem, we have a bit of a language barrier so it’s hard to understand what you really need.

I am just guessing here…

``````function kontrol(){

var i = 0;
for(x=0;x<marka.length;x++){
i = i + sayi[x].value;
}
}
}``````

m@tt, thank you

This is the name of Checkbox : name=“secilenreceivermarka_id[]”
This is the name of Select list: name=“secilen_receiver_sayisi[]”

1st rule: http://awesomescreenshot.com/0a1o6rh36 by DEFAULT

2nd rule: http://awesomescreenshot.com/07ao6s6c2 Required select amount

All the rules are these.

Thanks again

1st rule: AND 2nd rule: works no problem
3th rule: does not feature