home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / news_server.js < prev    next >
Encoding:
Text File  |  2006-05-08  |  2.4 KB  |  115 lines

  1. function leeren()
  2. {
  3.     document.formular.edit.value = '';
  4.     document.formular.Item.value = '';
  5. }
  6.  
  7. /**/
  8.  
  9. function Abfrage(edi, ext)
  10. {
  11.     var Check = confirm(txt[20][31]);
  12.  
  13.     if ((Check == true) && (pruefen() == true))
  14.     {
  15.         document.formular.edit.value = '' + edi + '';
  16.         document.formular.Item.value = '' + ext + '';
  17.         document.formular.submit();
  18.     }
  19.     else
  20.     {
  21.         document.formular.edit.value = '';
  22.         document.formular.Item.value = '';
  23.     }
  24. }
  25.  
  26. /**/
  27.  
  28. function edit(edi, ext)
  29. {
  30.     if (pruefen() == true)
  31.     {
  32.         document.formular.edit.value = '' + edi + '';
  33.         document.formular.Item.value = '' + ext + '';
  34.         document.formular.submit();
  35.     }
  36. }
  37.  
  38. /**/
  39.  
  40. function send()
  41. {
  42.     if (pruefen() == true)
  43.         document.formular.submit();
  44. }
  45.  
  46. /**/
  47.  
  48. function pruefen()
  49. {
  50.     var f1 = document.formular.T1.value;
  51.     var f2 = document.formular.T2.value;
  52.     var f3 = document.formular.T3.value;
  53.  
  54.     if (f1.charAt(f1.length - 1) == '\\')
  55.     {
  56.         alert(f1 + '\n\n' + txt[28][26]);
  57.         document.formular.edit.value = '';
  58.         document.formular.Item.value = '';
  59.         document.formular.T1.select();
  60.         document.formular.T1.focus();
  61.         return false;
  62.     }
  63.  
  64.     var tea = f1.split('\\');
  65.  
  66.     if (f1.substr(0, 2) != '\\\\')
  67.     {
  68.         if (/^([c-z])+([:])$/i.test(tea[0]) == false)
  69.         {
  70.             alert(tea[0] + '\n\n' + txt[28][22]);
  71.             document.formular.edit.value = '';
  72.             document.formular.Item.value = '';
  73.             document.formular.T1.select();
  74.             document.formular.T1.focus();
  75.             return false;
  76.         }
  77.     }
  78.  
  79.     var z = (f1.substr(0, 2) != '\\\\') ? 1 : 2;
  80.  
  81.     for (k = z; k < tea.length; k++)
  82.     {
  83.         if (/^([_a-z0-9- .]+)$/i.test(tea[k]) == false)
  84.         {
  85.             alert(tea[k] + '\n\n' + txt[28][23]);
  86.             document.formular.edit.value = '';
  87.             document.formular.Item.value = '';
  88.             document.formular.T1.select();
  89.             document.formular.T1.focus();
  90.             return false;
  91.         }
  92.     }
  93.  
  94.     if ((f2 != -1) && ((f2.match(/\D/) != null) || (f2 < 10) || (f2 > 9999)))
  95.     {
  96.         alert(txt[19][9] + txt[34][3] + ' "\t\n' + txt[34][9]);
  97.         document.formular.edit.value = '';
  98.         document.formular.Item.value = '';
  99.         document.formular.T2.select();
  100.         document.formular.T2.focus();
  101.         return false;
  102.     }
  103.  
  104.     if ((f3 == '') || (f3.match(/\D/) != null) || (f3 < 0) || (f3 > 1440))
  105.     {
  106.         alert(txt[19][9] + txt[34][16] + ' "\t\n' + txt[34][18]);
  107.         document.formular.edit.value = '';
  108.         document.formular.Item.value = '';
  109.         document.formular.T3.select();
  110.         document.formular.T3.focus();
  111.         return false;
  112.     }
  113.  
  114.     return true;
  115. }