Skip to content

TWebURLValidator

TWebURLValidator is a non-visual component that allows to perform a check whether an URL exists and works or not. Set the URL to test via TWebURLValidator.URL and call the Validate method. This will trigger the OnValidated event where the IsValid parameter will return whether the URL is valid or not.

Example:

procedure TForm1.WebFormCreate(Sender: TObject);
begin
  WebURLValidator1.URL := 'http://myurltotest.com';
  WebURLValidator1.Validate;
end;

procedure TForm1.WebURLValidator1Validated(Sender: TObject; IsValid: Boolean);
begin
  if IsValid then
    ShowMessage('The URL ' + WebURLValidator1.URL + ' works!');
end;

Properties for TWebURLValidator

Property Description
URL Sets the URL to check if it exists

Events for TWebURLValidator

Event Description
OnValidated Event triggered when the URL has been validated and returning whether it was a valid URL or not.