<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Getting URL with Hash Tags</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Getting URL with Hash Tags</description>
<language>en</language>
<pubDate>Thu, 18 Jun 2026 13:19:36 +0000</pubDate>

<item>
<title>yuniar on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9221</link>
<pubDate>Fri, 16 Apr 2010 08:59:46 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">9221@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm.. I think I found the problem. The code I posted above only work if the iframe content and the parent page are both coming from the same domain.&#60;/p&#62;
&#60;p&#62;In your case, they are different, hence top.location object won't work at all. This is security restriction within browsers.&#60;/p&#62;
&#60;p&#62;More detailed explanation here:&#60;br /&#62;
&#60;a href=&#34;http://stackoverflow.com/questions/1113902/what-exactly-can-an-iframe-do-with-the-top-location-object-cross-domain&#34; rel=&#34;nofollow&#34;&#62;http://stackoverflow.com/questions/1113902/what-exactly-can-an-iframe-do-with-the-top-location-object-cross-domain&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I can't find any workaround yet :( Sorry
&#60;/p&#62;</description>
</item>
<item>
<title>toddbuchanan on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9209</link>
<pubDate>Thu, 15 Apr 2010 19:30:00 +0000</pubDate>
<dc:creator>toddbuchanan</dc:creator>
<guid isPermaLink="false">9209@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yuniar...thanks again...I didn't realize it might add one more problem by putting it in an iFrame...I tried it and it doesn't get the current URL (it still gets the source: i.e. &#60;a href=&#34;http://www.toddbuchanan.com/machform/embed.php?id=6&#34; rel=&#34;nofollow&#34;&#62;http://www.toddbuchanan.com/machform/embed.php?id=6&#60;/a&#62;)...&#60;/p&#62;
&#60;p&#62;I did a quick read and found that the frames cause one problem:&#60;/p&#62;
&#60;p&#62;Didn't know if this might be an answer to the problem: &#60;a href=&#34;http://www.trans4mind.com/personal_development/JavaScript/jsFrames.htm&#34; rel=&#34;nofollow&#34;&#62;http://www.trans4mind.com/personal_development/JavaScript/jsFrames.htm&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Again, thank you so much...let me know if launching in a pop up window would work any better (if there was a way to pass a default value to form_6.element_9...)...
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9203</link>
<pubDate>Thu, 15 Apr 2010 18:52:55 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">9203@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Ah... right. I think &#34;window.location.href&#34; won't work when you embed the form within iframe.&#60;/p&#62;
&#60;p&#62;I see that you have implemented the code.&#60;br /&#62;
Can you try one more time for me?&#60;/p&#62;
&#60;p&#62;Try to replace:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;document.form_6.element_9.value = window.location.href;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with this one:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;document.form_6.element_9.value = top.location;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I think this one should get the parent URL instead of the form URL.
&#60;/p&#62;</description>
</item>
<item>
<title>toddbuchanan on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9202</link>
<pubDate>Thu, 15 Apr 2010 13:06:28 +0000</pubDate>
<dc:creator>toddbuchanan</dc:creator>
<guid isPermaLink="false">9202@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Fantastic! Thanks yuniar!&#60;/p&#62;
&#60;p&#62;I was hoping that if I embedded the form with the iFrame that it would pick up the URL with the hash tags, but since the hash tags are loaded client side (after Ajax creates the page) the javascript is only reading the URL where the form is first created.&#60;/p&#62;
&#60;p&#62;I wish I know more javascript (and I will try to find an answer to my own question) but I think what I need to do is either:&#60;/p&#62;
&#60;p&#62;A: have some sort of refresh take place so that the javascript will read the URL and the current hash tags once the page has loaded.&#60;/p&#62;
&#60;p&#62;Or &#60;/p&#62;
&#60;p&#62;B: Create some javascript submit action (maybe associated with your submit button?) so that it will grab the current URL and hash tag that the form is residing on (or embedded in) before submitting it.&#60;/p&#62;
&#60;p&#62;Thanks again...great product...
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9190</link>
<pubDate>Wed, 14 Apr 2010 17:28:29 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">9190@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm.. I think you can use a simple Javascript for this, without Ajax.&#60;/p&#62;
&#60;p&#62;For your form above (form id = 6 and the http referrer field is having id = element_9)&#60;br /&#62;
Edit your &#34;includes/view-functions.php&#34; file.&#60;/p&#62;
&#60;p&#62;Search line 1841:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;form id=&#38;quot;form_{$form-&#38;gt;id}&#38;quot; class=&#38;quot;appnitro&#38;quot; {$form_enc_type} method=&#38;quot;post&#38;quot; action=&#38;quot;#main_body&#38;quot;&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;change it to become:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;form id=&#38;quot;form_{$form-&#38;gt;id}&#38;quot; name=&#38;quot;form_{$form-&#38;gt;id}&#38;quot; class=&#38;quot;appnitro&#38;quot; {$form_enc_type} method=&#38;quot;post&#38;quot; action=&#38;quot;#main_body&#38;quot;&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then around line 1855, before the closing body tags, modify the code to be like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;img id=&#38;quot;bottom&#38;quot; src=&#38;quot;images/bottom.png&#38;quot; alt=&#38;quot;&#38;quot; /&#38;gt;

&#38;lt;script&#38;gt;
document.form_6.element_9.value = window.location.href;
&#38;lt;/script&#38;gt;

&#38;lt;/body&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;as you can see, between the img and body tag, we insert the javascript which assign the window.location.href into your http referrer field.
&#60;/p&#62;</description>
</item>
<item>
<title>toddbuchanan on "Getting URL with Hash Tags"</title>
<link>https://www.machform.com/forums/topic/getting-url-with-hash-tags#post-9183</link>
<pubDate>Tue, 13 Apr 2010 15:35:20 +0000</pubDate>
<dc:creator>toddbuchanan</dc:creator>
<guid isPermaLink="false">9183@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I am embeding my form with the iframe tags into a page on smugmug.com...a photo sharing site...and have been trying to get the referring URL included in my form so that when someone submits it...it will link back to the specific photo on that page, rather than just the gallery page that I am getting at the moment...&#60;/p&#62;
&#60;p&#62;I have been able to get the HTTP_Referr URL into one of my fields but I am working with a form (and site) that uses Hash (or Anchor) tags at the end. I know that PHP is server side and the hash tags get added on the client side after the page has been loaded, so my HTTP_Reffer URL does not contain anything that comes after the hash tag...&#60;/p&#62;
&#60;p&#62;I know that the javascript location.href or window.location.href do a great job of getting that info, but obviously, javascript and PHP don't play well together...&#60;/p&#62;
&#60;p&#62;I thought I saw a php HTTP_Hash command but at this point (after three long days of trying to find an answer) I am stumped...I'm no java/PHP expert, but know just enough to be dangerous...&#60;/p&#62;
&#60;p&#62;The site that I am working with (smugmug.com...a photo sharing website for my business) I thin is using AJAX...is there another solution for getting AJAX to insert something into one of my MachForm fields?&#60;/p&#62;
&#60;p&#62;Here is my form embeded in one of the pages:  &#60;a href=&#34;http://aacr3.smugmug.com/AACR-2010-Annual-Meeting/AACR-2010-Annual-Meeting/11756856_8qYrj#830059095_j3KUA&#34; rel=&#34;nofollow&#34;&#62;http://aacr3.smugmug.com/AACR-2010-Annual-Meeting/AACR-2010-Annual-Meeting/11756856_8qYrj#830059095_j3KUA&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks in advance!&#60;/p&#62;
&#60;p&#62;Todd
&#60;/p&#62;</description>
</item>

</channel>
</rss>
