Hyperlink on field text

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lbtony
Posts: 35
Joined: Tue Apr 11, 2006 9:01 am

Hyperlink on field text

Post by lbtony » Tue May 01, 2007 3:59 pm

How can I put a hyperlink in a text field? Is it possible?
Thanks.

marielle
Livecode Opensource Backer
Livecode Opensource Backer

Re: Hyperlink on field text

Post by marielle » Tue May 01, 2007 4:26 pm

lbtony wrote:How can I put a hyperlink in a text field? Is it possible?
Simply select the text you want to make into a link, then go to the top menu > Text > Link. Alternatively, edit set the htmltext of the field to something that contains a <a>http://mywebsite.com/</a> part.

To have the browser go to a webpage when the user press that link, create a handler

Code: Select all

on linkclicked pText
    revGoURL pText
end linkclicked
To have a real hyperlink, that is with what is being clicked a name rather than the link, add in the field script or anywhere above the field (card, stack)

Code: Select all

on linkclicked pText
   switch pText
     case "myWebsite"
        put "http://www.mywebsite.com/" into tURL
        break
    case "google"
        put "http://www.google.com/" into tURL
        break
    default 
        -- the link doesn't correspond to any predifined label. 
        -- either put pText into tURL, either issue a debug message to
        -- the programmer
    end switch
    revGoURL tURL
end linkclicked

nazrana
Posts: 1
Joined: Wed May 25, 2011 8:10 am

Re: Hyperlink on field text

Post by nazrana » Fri May 27, 2011 12:24 pm

What is the difference between hypertext and hyperlink? I know hyperlink is a link that takes you to another link. So tell me if this is right. Hyperlinks are a form of hypertext?
________________________________
market samurai ~ marketsamurai

Post Reply