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 Quote 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 Quote 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. Quote 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? Quote 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 Quote 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 Quote 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. Quote 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 (edited) 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 Edited November 28, 2012 by gecekule Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.