home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / dns_server_edit.js < prev    next >
Encoding:
Text File  |  2006-05-08  |  1.1 KB  |  57 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.     var fe = new Array('T1');
  14.     var va = new Array('\'', '"', ',', '\\');
  15.  
  16.     for (i = 0; i < fe.length; i++)
  17.     {
  18.         for (j = 0; j < va.length; j++)
  19.         {
  20.             var ei = document.formular.elements[fe[i]];
  21.  
  22.             if (ei.value.indexOf(va[j]) != -1)
  23.             {
  24.                 alert(txt[5][7] + va[j] + txt[5][8]);
  25.                 ei.select();
  26.                 ei.focus();
  27.                 return false;
  28.             }
  29.         }
  30.     }
  31.  
  32.     if (f1 == '')
  33.     {
  34.         alert(txt[19][9] + txt[38][6] + txt[39][1]);
  35.         document.formular.T1.select();
  36.         document.formular.T1.focus();
  37.         return false;
  38.     }
  39.  
  40.     if (f2 != '')
  41.     {
  42.         var ip = f2.split('.');
  43.  
  44.         for (k = 0; k < ip.length; k++)
  45.         {
  46.             if ((f2 == '255.255.255.255') || (ip.length != 4) || (isNaN(ip[k]) == true) || (ip[k] == '') || (ip[k] < 0) || (ip[k] > 255))
  47.             {
  48.                 alert(f2 + ', ' + txt[18][27]);
  49.                 document.formular.T2.select();
  50.                 document.formular.T2.focus();
  51.                 return false;
  52.             }
  53.         }
  54.     }
  55.  
  56.     return true;
  57. }