Brandon1
Novice

How to get parent url from K2 Form Viewer webpart?

I created a K2 Form which has button. On a sharepoint page, I added a K2 form viewer webpart and set it up with the K2 form that i created. When I click on the button in the form, I am trying to show the sharepoint page url. But I am not able to figure out how to get the sharepoint url to the page which has that webpart. . I followed the example at http://community.k2.com/t5/K2-blackpearl/How-to-get-the-current-URL-as-a-value-in-SmartForms/ta-p/82..., but this gives me the runtime/design time url of the k2 smartform wheras I need the sharepoint page url. Kindly help

 

0 Kudos
2 Replies
Mohamed2
Apprentice

Re: How to get parent url from K2 Form Viewer webpart?

0 Kudos
Brandon1
Novice

Re: How to get parent url from K2 Form Viewer webpart?

According to the comments in that post, that control uses the code

 

if (isInIframe) {
parentRawUrl = document.referrer;

 

If a person clicks/navigates to another page within the iframe, then this code will give the last navigated url , which I believe is the iframe itself and would not be useful.

Irrespective of iframe navigation, I would like to get the parent url.

0 Kudos