gecekule Posted November 26, 2012 Share Posted November 26, 2012 Hello, maximum the receiver does not work What could be the problem? Could you help me? Video: http://www.teklif.uzayforum.com/swf.html <script type="text/javascript"> function baslangic(status) { status=!status; textler=document.getElementsByName("secilen_receiver_sayisi[]"); for(x=0;x<textler.length;x++){ textler[x].disabled = status; } } function isaretle(){ marka=document.getElementsByName("secilenreceivermarka_id[]"); sayi=document.getElementsByName("secilen_receiver_sayisi[]"); for(x=0;x<marka.length;x++){ sayi[x].disabled=!marka[x].checked; } } function kontrol(){ marka=document.getElementsByName("secilenreceivermarka_id[]"); sayi=document.getElementsByName("secilen_receiver_sayisi[]"); for(x=0;x<marka.length;x++){ if(marka[x].checked==true&&(sayi[x].value><?=$maximum_receiver?>||sayi[x].value==""||sayi[x].value<1||sayi[x].value.search(/\d/g)<0)){ 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."); return false; } } return true; } </script> Thanks Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/ Share on other sites More sharing options...
gecekule Posted November 26, 2012 Author Share Posted November 26, 2012 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 Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395353 Share on other sites More sharing options...
codefossa Posted November 26, 2012 Share Posted November 26, 2012 You could check out they keyup event, then a regular if statement to check if greater than or equal to. Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395364 Share on other sites More sharing options...
gecekule Posted November 27, 2012 Author Share Posted November 27, 2012 I'm beginner, I do not know how to do it Could you help? Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395583 Share on other sites More sharing options...
codefossa Posted November 27, 2012 Share Posted November 27, 2012 Google is a wonderful thing. I'm not going to do it for you. I told you what you need to use, now it's up to you to do it. Capturing events with addEventListener() and the keyup event, as well as preventing default actions, and a simple if statement with an HTML modification. 4 lines of code (ignoring bracket lines) or 6 lines for alternative to warning when it's good Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395601 Share on other sites More sharing options...
gecekule Posted November 28, 2012 Author Share Posted November 28, 2012 I would ask you for help, I could not Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395827 Share on other sites More sharing options...
MDCode Posted November 28, 2012 Share Posted November 28, 2012 Google is a wonderful thing. I'm not going to do it for you. I told you what you need to use, now it's up to you to do it. Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1395923 Share on other sites More sharing options...
gecekule Posted November 28, 2012 Author Share Posted November 28, 2012 No need to prolong this thread Instead of such a message Two words were enough code I'm a beginner If you do not want to help myself, you could write Link to comment https://forums.phpfreaks.com/topic/271202-maximum-the-receiver-does-not-work/#findComment-1396006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.