1. JavaScript / Говнокод #4131

    +159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    echo "<script type='text/javascript'>  
    function checksubmit ( form )
                {  ";
        echo "if (acton) {";
    $get_count_parts="SELECT PartID, ProdDesc FROM Pr2  WHERE  ProdID='".$_SESSION["ProdID"]."' AND FOblig='*'";
    $get_count_parts1=mysql_query($get_count_parts);
    while ($pr=mysql_fetch_assoc($get_count_parts1))
    {
        echo"var zart".$pr['PartID']."=document.getElementsByName('21_".$pr['PartID']."')[0].value;
                  var name".$pr['PartID']."=document.getElementsByName('14_".$pr['PartID']."')[0].value;";    
    }
    echo "var curr=document.getElementsByName('20_1')[0].value;
              if (curr=='') { alert('Currency was not specified'); return false;}";
    $get_count_parts2=mysql_query($get_count_parts);
    while ($pr=mysql_fetch_assoc($get_count_parts2))
    {
        echo"else if (zart".$pr['PartID']."=='' &&  name".$pr['PartID']."!='') {alert('Art for ".$pr['ProdDesc']." was not specified'); return false;}";    
    }
    echo "}  return true; 
             } </script>";

    Запостил: Born, 31 Августа 2010

    Комментарии (8) RSS

    Добавить комментарий