How to make the hyper links clicable in rich Text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to make the hyper links clicable in rich Text field
Hello,
I have a few paragraphs in word document. Those paragraphs have couple of urls with rich text.
I copied those paragraphs in a rich text field but then the urls are not clickbale. Any idea how those urls can become clickable?
Another question is: I have a paragraph which contains a table and one image? How can I show that rich text pargaph with images and table in rev?? I have seen that when we copy that paragraph to rich text field then table and image do not get copied. Any idea what can be done to solve this issue?
thanks for your help
Best Regards
Pradeep
I have a few paragraphs in word document. Those paragraphs have couple of urls with rich text.
I copied those paragraphs in a rich text field but then the urls are not clickbale. Any idea how those urls can become clickable?
Another question is: I have a paragraph which contains a table and one image? How can I show that rich text pargaph with images and table in rev?? I have seen that when we copy that paragraph to rich text field then table and image do not get copied. Any idea what can be done to solve this issue?
thanks for your help
Best Regards
Pradeep
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
Hi Pradeep,
You cannot use tables inside a text field - images should work, as long as they're not inside a table, though.
If you want URL's to work, you'll need to set the 'lockText' property of the field to false (otherwise no events are triggered) and you'll have to handle the 'linkClicked' event.
Set the script of your field to something like:
Hope this helped,
Jan Schenkel.
You cannot use tables inside a text field - images should work, as long as they're not inside a table, though.
If you want URL's to work, you'll need to set the 'lockText' property of the field to false (otherwise no events are triggered) and you'll have to handle the 'linkClicked' event.
Set the script of your field to something like:
Code: Select all
on linkClicked theLink
launch URL theLink
end linkClicked
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Hi Pradeep,
I think Jan meant:
You might want to use an if-statement to check that theLink contains a valid URL.
Best,
Mark
I think Jan meant:
Code: Select all
on linkClicked theLink
revGoUrl URL theLink
end linkClicked
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Pradeep,
It looks like Revolution doesn't recognise the links and RTF doesn't have a "linked" or "grouped" style. The link you are copying is entered into the field as coloured, underlined text. Probably, you need to parse the text to recognise all links in it and set the textStyle of a text chunk to link if it appears to be a link. Sorry.
Mark
It looks like Revolution doesn't recognise the links and RTF doesn't have a "linked" or "grouped" style. The link you are copying is entered into the field as coloured, underlined text. Probably, you need to parse the text to recognise all links in it and set the textStyle of a text chunk to link if it appears to be a link. Sorry.
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
How to Get Link Value using clickChunk
Hey mark, thanks for your reply.
since the content will be genereated dynamically in the field and it will have many different hyperlinks. So I am not sure for which dynamic text I should set the textStyle to link.
I thought of using clickChunk (put the value of the clickChunk) But since the url is sepereated by puncutation so it does not give complete text.
for example if the url contains www.google.com then using clickChunk I recieve only www or . or google etc. Is there any way to ignore puncutation so that the clickchunk can give me complete url address ??
thanks for your insights.
since the content will be genereated dynamically in the field and it will have many different hyperlinks. So I am not sure for which dynamic text I should set the textStyle to link.
I thought of using clickChunk (put the value of the clickChunk) But since the url is sepereated by puncutation so it does not give complete text.
for example if the url contains www.google.com then using clickChunk I recieve only www or . or google etc. Is there any way to ignore puncutation so that the clickchunk can give me complete url address ??
thanks for your insights.
Problem with LinkClicked Handler
Hello ,
When I am trying the following code, it does not seeems to work
I am adding this code in the Text Field script, I have locked the field and also have locked the test but linkClicked function does not seems to be triggered.
Please let me know if you have any idea.
Thanks
Pradeep
When I am trying the following code, it does not seeems to work
Code: Select all
on linkClicked theLink
revGoUrl URL theLink
end linkClicked
Please let me know if you have any idea.
Thanks
Pradeep
Thanks Mark,
I corrected the command. but the problem is , it does not come to that handler itself.
I have a text filed. Inside that I have some text. Here is an HTML text of that field
But when I click on the link in the text field that it does not seems to recognize it as a link and neither goes to the handler below which is defined in the text Field.
The field is locked and also the text have been locked. I tried different combinations but it does not work.
Any Insights or sample stack where I can see it working?
Thanks
Best Regards
Pradeep
I corrected the command. but the problem is , it does not come to that handler itself.
I have a text filed. Inside that I have some text. Here is an HTML text of that field
Code: Select all
<p><a name="http://www.google.com/">www.google.com</a></p>
Code: Select all
on linkClicked theLink
answer "Hello"
revGoURL "http://www.google.com"
revGoURL theLink
end linkClicked
Any Insights or sample stack where I can see it working?
Thanks
Best Regards
Pradeep
Hi there,
I've just been playing around with this and found the following will work and get you started :
1. Create a new stack
2. Put a field on the stack
3. Enter some text into the field (for example "visit google")
4. Set the lockText of the field to true
5. Add the following handler to the fields script
on linkClicked theText
if theText is not empty then revGoURL theText
end linkClicked
6. In the message box issue the following 2 commands
set the linkText of line 1 of field 1 to "www.google.com"
set the textStyle of line 1 of field 1 to link
Now when you click the link, you will be taken to google.com
Hope this gives you a working base to start from
Regards,
Tim.
I've just been playing around with this and found the following will work and get you started :
1. Create a new stack
2. Put a field on the stack
3. Enter some text into the field (for example "visit google")
4. Set the lockText of the field to true
5. Add the following handler to the fields script
on linkClicked theText
if theText is not empty then revGoURL theText
end linkClicked
6. In the message box issue the following 2 commands
set the linkText of line 1 of field 1 to "www.google.com"
set the textStyle of line 1 of field 1 to link
Now when you click the link, you will be taken to google.com
Hope this gives you a working base to start from
Regards,
Tim.
To create the text in the text field,
I just typed the www.google.com in the content section of text field.
And then I set the Link Text of field like this
And to know what It has set , I used,
I hope this is the information you are asking for.
I just typed the www.google.com in the content section of text field.
And then I set the Link Text of field like this
Code: Select all
set the linkText of line 1 of field "test" to "http://www.google.com/"
And to know what It has set , I used,
Code: Select all
put the htmltext of field "test"