Hyperlink <a> inserted with onclick and re-onclick

11 posts, 1 answers
  1. miksh
    miksh avatar
    285 posts
    Member since:
    Nov 2006

    Posted 20 Mar 2013 Link to this post

    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
  2. Answer
    Rumen
    Admin
    Rumen avatar
    14146 posts

    Posted 20 Mar 2013 Link to this post

    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.
  3. miksh
    miksh avatar
    285 posts
    Member since:
    Nov 2006

    Posted 20 Mar 2013 Link to this post

    Great, then will update to the latest release.
  4. Max
    Max avatar
    4 posts
    Member since:
    Jan 2011

    Posted 02 Aug 2013 Link to this post

    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.
  5. Joana
    Admin
    Joana avatar
    205 posts

    Posted 02 Aug 2013 Link to this post

    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.
  6. Max
    Max avatar
    4 posts
    Member since:
    Jan 2011

    Posted 03 Aug 2013 Link to this post

    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
  7. Misho
    Admin
    Misho avatar
    198 posts

    Posted 07 Aug 2013 Link to this post

    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.
  8. Chad
    Chad avatar
    14 posts
    Member since:
    Mar 2007

    Posted 27 Feb 2014 Link to this post

    It's not just IE7 that  this happens in. We are seeing it in Firefox and in the latest Telerik Radcontrols package.
  9. Ianko
    Admin
    Ianko avatar
    1899 posts

    Posted 27 Feb 2014 Link to this post

    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.
  10. Chad
    Chad avatar
    14 posts
    Member since:
    Mar 2007

    Posted 27 Feb 2014 in reply to Ianko Link to this post

    Our issue is that even after you go back to HTML the onclick return false still shows up
  11. Ianko
    Admin
    Ianko avatar
    1899 posts

    Posted 28 Feb 2014 Link to this post

    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.
Back to Top