home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / httpserver.js < prev    next >
Encoding:
Text File  |  2006-07-25  |  3.6 KB  |  204 lines

  1. function leeren()
  2. {
  3.     with (document.formular)
  4.     {
  5.         edit.value = '';
  6.         Item.value = '';
  7.     }
  8. }
  9.  
  10. /**/
  11.  
  12. function feld_disabled()
  13. {
  14.     with (document.formular)
  15.         T4.disabled = (C2.checked) ? false : true;
  16. }
  17.  
  18. /**/
  19.  
  20. function Abfrage(edi, ite)
  21. {
  22.     var Check = confirm(txt[20][31]);
  23.  
  24.     with (document.formular)
  25.     {
  26.         if (Check && pruefen())
  27.         {
  28.             T4.disabled = (C2.checked || (T4.value == '')) ? false : true;
  29.  
  30.             edit.value = edi;
  31.             Item.value = ite;
  32.  
  33.             submit();
  34.         }
  35.         else
  36.         {
  37.             edit.value = '';
  38.             Item.value = '';
  39.         }
  40.     }
  41. }
  42.  
  43. /**/
  44.  
  45. function edit(edi, ite)
  46. {
  47.     with (document.formular)
  48.     {
  49.         if (pruefen())
  50.         {
  51.             T4.disabled = (C2.checked || (T4.value == '')) ? false : true;
  52.  
  53.             edit.value = edi;
  54.             Item.value = ite;
  55.  
  56.             submit();
  57.         }
  58.     }
  59. }
  60.  
  61. /**/
  62.  
  63. function send()
  64. {
  65.     if (pruefen())
  66.     {
  67.         with (document.formular)
  68.         {
  69.             T4.disabled = (C2.checked || (T4.value == '')) ? false : true;
  70.             submit();
  71.         }
  72.     }
  73. }
  74.  
  75. /**/
  76.  
  77. function pruefen()
  78. {
  79.     with (document.formular)
  80.     {
  81.         var f1 = T1.value;
  82.         var f2 = T2.value;
  83.         var f3 = T3.value;
  84.         var f4 = T4.value;
  85.         var pr = new Array(f1, f2);
  86.         var fe = new Array('T1', 'T2');
  87.  
  88.         for (var i = 0; i < pr.length; i++)
  89.         {
  90.             var se = elements[fe[i]];
  91.  
  92.             if (pr[i].charAt(0) == '"')
  93.             {
  94.                 alert(txt[28][28]);
  95.                 edit.value = '';
  96.                 Item.value = '';
  97.                 se.select();
  98.                 se.focus();
  99.                 return false;
  100.             }
  101.  
  102.             if (pr[i].charAt(pr[i].length - 1) == '\\')
  103.             {
  104.                 alert(pr[i] + '\r\n\r\n' + txt[28][26]);
  105.                 edit.value = '';
  106.                 Item.value = '';
  107.                 se.select();
  108.                 se.focus();
  109.                 return false;
  110.             }
  111.  
  112.             if (pr[i].substr((pr[i].length - 2), 2) == '\\"')
  113.             {
  114.                 alert(pr[i].substr(0, (pr[i].length - 1)) + '\r\n\r\n' + txt[28][26]);
  115.                 edit.value = '';
  116.                 Item.value = '';
  117.                 se.select();
  118.                 se.focus();
  119.                 return false;
  120.             }
  121.  
  122.             var tea = pr[i].split('\\');
  123.  
  124.             if (pr[i].substr(0, 2) != '\\\\')
  125.             {
  126.                 if (/^([c-z])+([:])$/i.test(tea[0]) == false)
  127.                 {
  128.                     alert(tea[0] + '\r\n\r\n' + txt[28][22]);
  129.                     edit.value = '';
  130.                     Item.value = '';
  131.                     se.select();
  132.                     se.focus();
  133.                     return false;
  134.                 }
  135.             }
  136.  
  137.             var z = (pr[i].substr(0,2) != '\\\\') ? 1 : 2;
  138.  
  139.             for (var k = z; k < tea.length; k++)
  140.             {
  141.                 if (tea[k].indexOf(' ') != -1)
  142.                 {
  143.                     if (tea[k].indexOf('"') == -1)
  144.                     {
  145.                         alert(txt[29][13] + '\r\n\r\n"' + tea[k] + '"');
  146.                         edit.value = '';
  147.                         Item.value = '';
  148.                         se.select();
  149.                         se.focus();
  150.                         return false;
  151.                     }
  152.                 }
  153.  
  154.                 if (tea[k].indexOf('"') != -1)
  155.                 {
  156.                     if ((tea[k].charAt(0) != '"') || (tea[k].charAt(tea[k].length - 1) != '"'))
  157.                     {
  158.                         alert(txt[29][14] + '\r\n\r\n"' + tea[k] + '"');
  159.                         edit.value = '';
  160.                         Item.value = '';
  161.                         se.select();
  162.                         se.focus();
  163.                         return false;
  164.                     }
  165.                 }
  166.  
  167.                 var x   = (tea[k].charAt(0) != '"') ? 0 : 1;
  168.                 var teb = tea[k].slice(x, tea[k].length - x);
  169.  
  170.                 if (/^([_a-z0-9- .]+)$/i.test(teb) == false)
  171.                 {
  172.                     alert(teb + '\r\n\r\n' + txt[28][23]);
  173.                     edit.value = '';
  174.                     Item.value = '';
  175.                     se.select();
  176.                     se.focus();
  177.                     return false;
  178.                 }
  179.             }
  180.         }
  181.  
  182.         if ((f3.match(/\D/) != null) || (f3 < 10) || (f3 > 1200))
  183.         {
  184.             alert(txt[19][9] + txt[29][9] + ' "\t\r\n' + txt[29][12]);
  185.             edit.value = '';
  186.             Item.value = '';
  187.             T3.select();
  188.             T3.focus();
  189.             return false;
  190.         }
  191.  
  192.         if (C2.checked && (f4 == ''))
  193.         {
  194.             alert(txt[22][8] + txt[29][18] + txt[22][9]);
  195.             edit.value = '';
  196.             Item.value = '';
  197.             T4.select();
  198.             T4.focus();
  199.             return false;
  200.         }
  201.     }
  202.  
  203.     return (filter_send()) ? true : false;
  204. }