maximum the receiver does not work

Hello,

maximum the receiver does not work

What could be the problem?
Could you help me?

See: http://awesomescreenshot.com/004ne0pd6
[php]

[/php]

Thanks

Video: http://www.teklif.uzayforum.com/swf.html

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

Can you help please?

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?

screen: http://awesomescreenshot.com/004ne0pd6
AND
Video: http://www.teklif.uzayforum.com/swf.html

For all selects, “maximum_receiver” amount

Allowed maximum_receiver amount=16
Sample:
2. 16
4. 10
5. 12

16+10+12=38, allowed 16 and alert()

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;
}
if (i > <?=$maximum_receiver?>) {
	alert('Too high');
}

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;
}
if (i > <?=$maximum_receiver?>) {
alert(‘Too high’);
}
[/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(){

marka=document.getElementsByName("secilenreceivermarka_id[]");
sayi=document.getElementsByName("secilen_receiver_sayisi[]");
var i = 0;
for(x=0;x<marka.length;x++){
   i = i + sayi[x].value;
}
if (i > <?=$maximum_receiver?>) {
return alert("Receiver seçme isteğe bağlıdır.\n\nEğer bir marka seçtiniz ise miktarıda seçmelisiniz ve toplam daire sayınız olan <?=$maximum_receiver?> adet geçmemeniz gerekiyor.");
}
}

m@tt, thank you

This is the name of Checkbox : name=“secilenreceivermarka_id[]”
This is the name of Select list: name=“secilen_receiver_sayisi[]”
Maximum amount variable: <?=$maximum_receiver?>

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

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

3th rule: http://awesomescreenshot.com/0beo6tmec

All the rules are these.

Thanks again

1st rule: AND 2nd rule: works no problem
3th rule: does not feature
Will you please help?

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service