Infopath 2010: Anyway to make a hyperlink in a rich text control open in the same window?

Answered Infopath 2010: Anyway to make a hyperlink in a rich text control open in the same window?

  • martedì 13 marzo 2012 17:32
     
     

    I am creating hyperlinks dynamically in a rich text box control, within a repeating table. I cant seem to force the links to open in the same window, I have tried setting the target property of the hyperlink with no success. Any other ways to accomplish this? 

    Thanks

Tutte le risposte

  • martedì 13 marzo 2012 21:15
     
     Con risposta

    Hi Sean,

    I saw this blog post and with the help of jQuery it should be possible. I have never tried this aproach so I don't know if it works but maybe it's worth a try?


    Blog: Married to SharePoint Twitter: @SPNiax

  • mercoledì 14 marzo 2012 17:22
     
     
    Thanks SPNiax, any idea of how I would go about this for setting hyperlink target behaviour in html running in a rich text field, an example maybe? I'm not too familiar with JQuery, as I am mostly an asp/c# developer, yet have found the time savings of using infopath to construct complicated business forms and run them within a XmlFormView control on the page. Is this impossible to do within Infopath, or maybe some other way to force the link to open in the same window? Any other information or approaches would be greatly appreciated. 
  • giovedì 15 marzo 2012 05:53
    Moderatore
     
     Con risposta

    Hi ,

    There are two ways to make the hyperlinks to open in the same window .

    1. You can change the IE settings :Tools>Internet Options. Click Settings behind ‘Change how webpages are displayed in tabs’ under the General tab .Check ‘Always open a pop-up in a new tab ’ .
    2. You can use JQuery to change the target of a hyperlink to _self just as SPNiax suggests .

    Thanks


    Entan Ming

    TechNet Community Support

  • martedì 20 marzo 2012 22:29
     
     
    Ok, can anyone post a jquery example related to setting hyperlink properties? In the meantime, I will do some reading about JQuery :) 
  • mercoledì 21 marzo 2012 04:58
    Moderatore
     
     

    Hi ,

    Here are some JQuery codes to change the link properties ,you can refer to these sites for more information :

    Change Link With Jquery (or javascript) : http://www.codingforums.com/showthread.php?t=172438
    How to change the href for a hyperlink using jQuery : http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery
    jQuery API: http://api.jquery.com/attr/

    Thanks



    Entan Ming

    TechNet Community Support