-1

Hi How can I access iframe parent page and store url in input tag from javascript,i try eniting byt not result best for me.

I have one htm page in and the other side where the form with buttons. I need the other form (ekternal_form.aspx) access to the parent and to get url and store url in my input tag.

    <label for="first_name"><%=GetPhrase("FORMFIELD_FIRSTNAME")%>:</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br/>

    <label for="last_name"><%=GetPhrase("FORMFIELD_LASTNAME")%>:</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br/>

    <label for="email"><%=GetPhrase("FORMFIELD_EMAIL")%>:</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br/>

    <label for="phone"><%=GetPhrase("FORMFIELD_PHONE")%>:</label><input  id="phone" maxlength="40" name="phone" size="20" type="text" /><br>

    <label for="description"><%=GetPhrase("FORMFIELD_DESCRIPTION_INSIDE")%>:</label><textarea name="description"></textarea><br/>

    <input type="hidden"  id="00Nb0000001Vrag" name="00Nb0000001Vrag" size="20" type="text" value='<%=MyCookies.Tracker() %>' />

    <!--UserIP-->
    <input type="hidden"  id="00Nb0000002EPku" maxlength="20" name="00Nb0000002EPku" size="20" type="text" value='<%Response.Write(Request.ServerVariables("remote_addr"))%>'  /><br>

    <textarea style="display:none;" id="00Nb0000001Vraq" name="00Nb0000001Vraq" rows="10" type="text" wrap="soft"><%=Request.ServerVariables("HTTP_REFERER") %></textarea>

    <!--Referral URL-->
    <textarea style="display:none;"  id="00Nb0000002EPl3" name="00Nb0000002EPl3" rows="5" type="text" wrap="soft"><%=Request.ServerVariables("HTTP_REFERER") %></textarea><br>
    <label for="ParentPage">ParentPage</label><input id="parentpage" name="ParentPage" type="text" value=""  /><br />


    <input type="submit" name="submit"   class="button" value='<%=GetPhrase("FORMFIELD_SEND")%>' />
  </asp:Panel>
</form>
user1798078
  • 15
  • 1
  • 3
  • 11

1 Answers1

0

Check my answer of this question.

What you have to do is append whatever data (in this case parent page title) you to capture to the iframe source url and then parse it from the page within. There is no other way.

Community
  • 1
  • 1
sandip
  • 70
  • 4
  • Sorry Where should I add the home parent page title? – user1798078 Apr 10 '13 at 10:24
  • And then, parse the src attribute from yourpage.aspx and capture pagetitle value. – sandip Apr 10 '13 at 10:32
  • I got to iframe tag the second page that called my form(external_form) – user1798078 Apr 10 '13 at 10:41
  • i write js function and set onclick="url()" my input tag id="parentpage" and after click show me popup window from url address function is: function url() { alert(parent.document.location.href); } – user1798078 Apr 10 '13 at 11:11
  • this is solution var referrer = document.referrer; alert(referrer); and new JS code for write link in my textbox value document.getElementById("parentpage1").value = document.referrer; – user1798078 Apr 11 '13 at 08:21