This is a migrated thread and some comments may be shown as answers.

Hyperlink <a> inserted with onclick and re-onclick

10 Answers 188 Views
Editor
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 20 Mar 2013, 02:49 PM
Hello,

We currently use ver. 2012.3.1016.40 and noticed a very strange pattern when the html with links edited by radEditor was saved into database as
<a href="/path" target="_blank" onclick="return false;">some text</a>
or even more weird:
<a href="/path" target="_blank" onclick="return false;" re_target="_blank" re_onclick="return false;">some text</a>

which makes links non-clickable. Not quite sure how that happened, most likely when edited in Chrome.
Is it a known & fixed  issue? I could not find any related info the release notes  for the next releases.

Thanks in advance.
Mike

10 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 20 Mar 2013, 03:12 PM
Hi,

I am aware of this problem and it happens when submitting the content from Preview mode.

The problem is already fixed in Q1 2013 (2013.1.220). If you are currently unable to upgrade, you can disable the Preview mode by setting EditModes="Design,Html".

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
miksh
Top achievements
Rank 1
Iron
answered on 20 Mar 2013, 03:18 PM
Great, then will update to the latest release.
0
Max
Top achievements
Rank 1
answered on 02 Aug 2013, 07:31 AM
Hi Rumen,

I had same problem with inserted "onclick" and upgraded to 2013.2.717.40 per this article, but when content is saved from "Preview" it still has the onclick. It appears as if the issue was not fixed and we still must hide the "Preview" mode. Is that correct?
Please advise.

Thank you,
Max.
0
Joana
Telerik team
answered on 02 Aug 2013, 03:35 PM
Hi Max,

I am not able to reproduce the issue with our latest version of the RadControls. Could you please check whether you reproduce the issue in our demo that shows the same functionality? I have attached a video with the behavior on my side. Please tell me if I have missed something.

However, a possible workaround for the issue would be to set the following code the OnClientSubmit event of the RadEditor:

<telerik:RadEditor OnClientSubmit = "OnClientSubmit" />
 
<script>
   function OnClientSubmit(editor)
   {
   editor.set_mode(1); //Force design mode
   }
</script>

I hope this information will help you resolve the issue.

Regards,
Joana
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Max
Top achievements
Rank 1
answered on 04 Aug 2013, 04:22 AM
Hi Joana,

Thank you for suggested workaround, it worked.

Also I tried it in your demo site and I was able duplicate the issue. Please see attached image.
I was simply adding several lines of links
11111111
22222222
33333333
44444
using document manager to upload PDF files, then I clicked "Preview" mode and clicked Save to Database. Then content was totlally messed up. See second image. It should not be like this in design mode. Please advise.

Thank you,
Max
0
Misho
Telerik team
answered on 07 Aug 2013, 12:00 PM
Hi,

Thank you for the provided reproduction steps. I confirm the issue is reproducible in Internet Explorer 7 and I've logged it in our bug tracking system. In addition you could find it in our public feedback portal with ID 55297 , where you could follow it, comment and vote.
As a small token of gratitude for bringing this bug to our attention I have updated your telerik points accordingly.

Regards,
Misho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Chad
Top achievements
Rank 1
answered on 27 Feb 2014, 12:32 PM
It's not just IE7 that  this happens in. We are seeing it in Firefox and in the latest Telerik Radcontrols package.
0
Ianko
Telerik team
answered on 27 Feb 2014, 12:54 PM
Hi Chad,

Note that the Links' attributes are modified in Preview mode on purpose. This way clicking on them will not trigger any functionality and if it happens that a link is being opened it will be opened in a new tab. This is done by getting the onClick and target attributes, preserving the value with custom attributes re_onclick and re_target. When passing again to Design mode, the correct attributes are being returned to their original values.

You can overview them mentioned behavior with this screencast, in which I am using Firefox and teh dev toolbar to investigate the results from switching to Preview and Design mode.

Note that submitting or using the content removes these custom attributes and all links should be correctly formed.

If it happens that I am mislead on the occurred problem, please open a proper support ticket with more details on the issue and exact steps, so that we could investigate the problem and assist you on this.

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Chad
Top achievements
Rank 1
answered on 27 Feb 2014, 01:26 PM
Our issue is that even after you go back to HTML the onclick return false still shows up
0
Ianko
Telerik team
answered on 28 Feb 2014, 07:21 AM
Hello Chad,

I saw that you have opened a ticket on this matter, please refer to it for more information.

For anyone interested about this issue:

The encountered problem is that every created link without an onclick attribute is automatically set with an onclick="return false;" value. This is a bug introduced in RadEditor from version 2013 Q3 SP2. Fortunately it was logged and resolved in the following version - 2014 Q1.

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Editor
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Rumen
Telerik team
miksh
Top achievements
Rank 1
Iron
Max
Top achievements
Rank 1
Joana
Telerik team
Misho
Telerik team
Chad
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or