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

  1. function send()
  2. {
  3.     if (pruefen() == true)
  4.         document.formular.submit();
  5. }
  6.  
  7. /**/
  8.  
  9. function pruefen()
  10. {
  11.     var f1 = document.formular.T1.value;
  12.     var f2 = document.formular.T2.value;
  13.  
  14.     if (f1 == '')
  15.     {
  16.         alert(txt[19][9] + txt[34][6] + txt[35][4]);
  17.         document.formular.T1.select();
  18.         document.formular.T1.focus();
  19.         return false;
  20.     }
  21.     else
  22.     {
  23.         for (i = 0; i < f1.length; i++)
  24.         {
  25.             if (/^([a-z0-9-.]+)$/i.test(f1) == false)
  26.             {
  27.                 alert(txt[19][9] + txt[34][6] + txt[35][5]);
  28.                 document.formular.T1.select();
  29.                 document.formular.T1.focus();
  30.                 return false;
  31.             }
  32.         }
  33.     }
  34.  
  35.     var fe = new Array('T2');
  36.     var va = new Array('\'', '"');
  37.  
  38.     for(i = 0; i < fe.length; i++)
  39.     {
  40.         for (j = 0; j < va.length; j++)
  41.         {
  42.             var ei = document.formular.elements[fe[i]];
  43.  
  44.             if (ei.value.indexOf(va[j]) != -1)
  45.             {
  46.                 alert(txt[5][7] + va[j] + txt[5][8]);
  47.                 ei.select();
  48.                 ei.focus();
  49.                 return false;
  50.             }
  51.         }
  52.     }
  53.  
  54.     return true;
  55. }