Results 1 to 3 of 3

Thread: Verfication of a form field

  1. #1
    Join Date
    Oct 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Verfication of a form field

    Can anyone tell me how I can use this script sent to me (I'm assuming it's all there!) to verify an entry into an html form field? Thanks.

    Code:
    function Letra(Numero: Integer): string;
    begin
    Result:= copy('TRWAGMYFPDXBNJZSQVHLCKET',1 + numero mod 23,1);
    end;
    
    function EsNif(NIF: String): Boolean;
    var
    Numero: Integer;
    begin
    Result:= FALSE;
    if TryStrToInt(Copy(NIF,1,Length(NIF)-1),Numero) then
    Result:= Uppercase(Copy(NIF,Length(NIF),1)) = Letra(Numero);
    end;
    
    function EsNumero(Num: Char): Boolean;
    begin
    try
    StrToInt(Num);
    Result:=True;
    Except
    result:=False;
    end;
    end;
    
    {Eliminamos espacios y separadores}
    function CadLimpiaCar(NIF: String): String;
    begin
    Result:= NIF;
    while (pos(' ',NIF)>0) do
    delete(NIF,pos(' ',NIF),1);
    while (pos('-',NIF)>0) do
    delete(NIF,pos('-',NIF),1);
    while (pos('/',NIF)>0) do
    delete(NIF,pos('/',NIF),1);
    Result:=NIF;
    end;

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Um... what makes you think this is Javascript or at all applicable to HTML forms? It looks like some form of Pascal.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Oct 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah - that answers my question then (I'd presumed because of how it was sent to me).... Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •