VS: VS: Newbie: get hyperlink working?
janschenkel at yahoo.com
Tue Sep 10 05:24:01 CDT 2002
--- Esa_Kivelä <Esa.Kivela at ncrc.fi> wrote:
> Hmmm that button write that typed text fron text
> field into www-page (don't ask me users just want
> So if INSIDE text field is like httP://ncrc.fi so
> when button is pressen how it can write that
> "http://ncrc.fi" as link into www page not as text
> from text field?
If I understand you correctly, you want a text field,
where users can type in all sorts of stuff, and then
select a chunk of text, and click a button "Make link"
to add a HREF style link.
In that case, try the following:
1) set the button's "autoHilite" off
2) set its script to:
put the selectedChunk into tChunk
if tChunk is not empty and (word 4 of tChunk >= \
word 2 of tChunk) then # there is a selection
put the value of tChunk into tLink
# you could adapt tLink (eg: prepend "http://")
set the textStyle of tChunk to "link"
set the linkText of tChunk to tLink
If that wasn't what you wanted, I hope it helped
anyway, and you're always free to post another
"As we grow older, we grow both wiser and moire
foolish at the same time." (De Rochefoucald)
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
More information about the use-livecode