Hello, I'm having trouble accessing the parent page of an iframe using JavaScript. I've tried different methods but haven't found a solution that works well for me.
I have one HTML page and another page with a form and buttons. I need the form on the second page (external_form.aspx) to access the parent page, retrieve the URL, and store it 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>