>I'm trying to figure out how to use a FFC Hyperlink Label class to provide a MAILTO link on a form (e.g., 'mailto:
fred@splat.com'). The problem is that the class seems to prepend 'http://' to the font of the URL if it isn't already there, which makes the browser ignore the 'MAILTO' part.
>
>Can this not be done with Hyperlink Label, or am I perhaps not setting something correctly?
>
>-- jas
Change the validurl method in the _hyperlinkbase class with this code
LPARAMETERS tcURL
LOCAL lcURL
IF EMPTY(tcURL)
RETURN ""
ENDIF
lcURL=ALLTRIM(tcURL)
IF NOT LOWER(LEFT(lcURL,5))=="http:" and NOT LOWER(LEFT(lcURL,7))=="mailto:" AND NOT LOWER(LEFT(lcURL,5))=="file:" AND ;
(LOWER(LEFT(lcURL,4))=="www." OR ;
INLIST(LOWER(RIGHT(lcURL,4)),".com",".gov",".net") OR ;
(NOT SUBSTR(lcURL,2,1)==":" AND NOT LEFT(lcURL,2)=="\\"))
lcURL="http://"+lcURL
ENDIF
IF SUBSTR(PADR(lcURL,5),5,1)==":" .OR. SUBSTR(PADR(lcURL,7),7,1)==":"
lcURL=STRTRAN(STRTRAN(lcURl,"\","/"),"///","//")
ELSE
lcURL="file://"+STRTRAN(STRTRAN(STRTRAN(lcURL,"\","/"),"///","//"),"//","/")
ENDIF
RETURN lcURL