Results 1 to 1 of 1

Thread: Button in iframe not working properly

  1. #1
    Join Date
    Mar 2009

    Button in iframe not working properly

    Why doesn't this form work when the button is clicked? It is inside an iframe. I sent the controls to an iframe from a different website. When I hover my mouse over the Resubmit button, I can see the correct url in my browser bar. (lower left) This is the same one as the save button. Does the fact that the Resbmit button is in an iframe create a problem? The green bar in my browser shows the page load quickly and vanishes doing nothing. Is this a security issue?

    I was trying to use the Copy url to clipboard button to copy the selected url in the dropdown to the clipboard. Then the user could paste it into the Recipcocal url field in the form and click the Save button again. (see picture) The form is on the page with the iframe. The copy to clipboard button doesn't work either. I'm trying to get the selected item in the dropdown copied to the Reciprocal url textbox right before the Save button in the form. Again, the iframe controls including a dropdownbox, a label and a button are sent from a remote website to the page. When I clicked the button to try to copy the dropdown item to the web_recip I got an access denied error. How does one get around this?

    <form name="ctl01" method="post" action="http://www.link-exchangers.com/adv_links_addbycustomer.aspx" id="ctl01" target="hdnFrm">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUaUXIyTcD6f05q0zIbv4QVbpto4s=" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="//2DwKU+M6MDwK8m8+dCQKy8rjSBwLD+aWMBALcwYfHCALrp+eHDwKggI3ODAKvtqqBBgKjs8y4CAKqiLHeDgK34agCBNfAteTeI3X oiXVXjCs/J0yEnNM=" />
    <div style="background-color:White;">
    <span id="lblMsg" class="ErrorText" style="font-weight:bold;"></span>
    <span id="Label1" style="font-size:X-Small;font-weight:bold;">Valid Urls</span>
    <select name="DropDownList1" id="DropDownList1" name="web_recip" style="background-color:#EFEFEF;border-color:#898989;border-width:1px;border-style:Solid;font-size:8pt;padding:0px;">
    <option value="0"> - Select - </option>
    <option value="http://www.scotking.com/index.htm">http://www.scotking.com/index.htm</option>
    <option value="http://www.scotking.com/links/barberpianosonata.htm">http://www.scotking.com/links/barberpianosonata.htm</option>
    <option value="http://www.scotking.com/pianist/videos.htm">http://www.scotking.com/pianist/videos.htm</option>

    <input type=submit value="Resubmit" style='width:100px'>

    <input name="Copy" type="button" id="Copy" value="Copy Url to Clipboard" onclick="copy();" style="vertical-align: top;" />

    <br />
    <br />

    <script type="text/javascript">
    function copy()
    var sel = document.getElementById("DropDownList1");
    var text = sel.options[sel.selectedIndex].value;
    // Assigning selected value of DropDownList to a hidden TextArea
    document.getElementById("hdnTextBox").value = text;

    // Creating text range from hidden TextArea's content
    var CopiedTxt = document.getElementById("hdnTextBox").createTextRange();

    // Copying the teat range to clipboard
    //var out = parent.document.form1.getElementById("web_recip");
    // out.value = text + "\n";

    here is the php page which has the iframe outside the form tags.

    <iframe id="hdnFrm" name="hdnFrm" src="" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="width:90&#37;; height:50px"></iframe>

    <form action='http://www.link-exchangers.com/adv_links_addbycustomer.aspx' target='hdnFrm' method='post' name='form1'>
    <table width=90% align=center cellpadding=2 cellspacing=0 border=0>
    <tr><td valign=top>Contact email: </td><td><input type=text name=web_email value="<?=$web_email;?>" style='width:250px'></td></tr>
    <tr><td valign=top>Web site title: </td><td><input type=text name=web_title value="<?=$web_title;?>" style='width:250px'></td></tr>
    <tr><td valign=top>Your url: </td><td><input type=text name=web_url value="<?=$web_url ;?>" style='width:250px'></td></tr>
    <tr><td valign=top>Site description: </td><td><textarea name=web_desc style='width:250px; height:70px'><?=$web_desc;?></textarea></td></tr>
    <tr><td valign=top>Select category: </td><td><select name=web_categ style='width:250px'><?=$categories;?></select></td></tr>
    <tr><td valign=top>Reciprocal link: </td><td><input id=web_recip type=text name=web_recip value="<?=$web_recip;?>" style='width:250px'></td></tr>
    <tr><td colspan=2 align=center><input type=submit value="Save" style='width:100px'></td></tr>
    Last edited by seotool; 08-28-2010 at 05:06 PM.
    Scot King
    Get the best link exchange software on the net !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles