6. Februar 2010 12:21
tsCheckPhone = function(tel) 
{
  var regEx = /^\+[0-9]{1,4} (0?[ \(\)0-9]{1,})$/;
  return tel.match(regEx);
}if(crmForm.all.telephone1)
{
   if(crmForm.all.telephone1.DataValue != null)
   {
      var telephonenumber = tsCheckPhone(crmForm.all.telephone1.DataValue);
      if(!telephonenumber) 
      {
         alert('Ungültige Nummer, bitte verwenden Sie +49 (251)123456');
         crmForm.all.telephone1.SetFocus();
         // Durch diese 2 Befehle wird der Datensatz nicht gespeichert!!!
         event.returnValue=false;
         return false;   
      }
   }
}if(crmForm.all.telephone1.DataValue != null)
{
   var telephonenumber = tsCheckPhone(crmForm.all.telephone1.DataValue);
   if(!telephonenumber)
   {
     alert('Ungültige Nummer, bitte verwenden Sie +49 (251) 123456');
     crmForm.all.telephone1.SetFocus();
   }
}14. Februar 2010 13:27