Sohail Sajid
Sohail Sajid

Reputation: 1

How to show result into a textarea comming from an Ifram with jquery?

I i have an iframe in which i am uploading a text file and after uploading reads its contents which are only urls. the problem is that i am unable to show the result in a textarea where this iframe is called someone please get me out from this. my code is below. this is the code of i frame.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $(this).parent().find("#social_media_urls").val("<?php echo $links?>");
    });
</script>
</body>
</html>

and blow is the html where i want to show the result.

<div class="tabs-content" id="tab_social_urls">
  <ul>
    <li>
      <div class="left"> Upload URLs (csv): </div>
      <div class="rite">
        <iframe id="uploadFile" src="<?php echo "includes/iframe_upload_file.php" ;?>"></iframe>
      </div>
      <div class="clr"></div>
    </li>
    <li>
      <div class="left"> Current URLs: </div>
      <div class="rite">
        <textarea name="social_media_urls" id="social_media_urls" cols="" rows="">

                                                </textarea>
      </div>
      <div class="clr"></div>
    </li>
  </ul>
  <div class="clr"></div>
</div>

i want to show the result in text area.

Upvotes: 0

Views: 143

Answers (2)

muthu
muthu

Reputation: 5461

If you use like this you may set value in the text area

<script type="text/javascript">
    $(document).ready(function(){
        $("#social_media_urls").val("<?php echo $links?>");
    });
</script>

Upvotes: 1

Robyflc
Robyflc

Reputation: 1209

Last time I had that issue, I solved using something like:

parent.$('#social_media_urls') ...

Upvotes: 0

Related Questions