#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    13
    Rep Power
    0

    Question Global Standard Email field validation in Delphi 6


    Hi All,
    Just wanna ask if there is any standard email field validation in Delphi 6?

    Actually I've did some email validation on my own, below is how I control :

    if (Pos('@', ownEmail.Text) <= 0) or (Pos('.',ownEmail.Text) <= 0) Then

    Begin
    MsgDlg('Invalid Email',mtInformation,[mbOk]);
    ownEmail.SetFocus;
    Exit;
    End;

    But seems when user tested the system, they are quite creative and report the system bugs that the system still can accpet email value like "@abc.com", "er@ra@.com", "re...@com" etc. Since there are so many possibility that the user can enter, thats why I wanna ask, is there any standardization for email validation in Delphi 6?

    Thanks...
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Behind you
    Posts
    19
    Rep Power
    0
    try to use a mask edit..or you can make a series of concatenated if.

    // *********
    i := pos('@',s);
    If i = 0 then error else
    begin
    delete(s,i,1);
    i := pos('@',s);
    if i = 0 then ok

    again again again do it also for "." and for another signs..

    byez

IMN logo majestic logo threadwatch logo seochat tools logo