SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Sweden
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating textarea from another file

    I have an ASP document containing an <IFRAME>. The contents in the IFRAME is retrieved from another file (<IFRAME SRC="SMTable.htm" WIDTH=510 HEIGHT=500>). It contains a table. There's a TEXTAREA in the ASP document which I want to update when a row in the table is clicked. Getting the clicked row is solved via this. I found this which updates a textbox in the parent window after a child windows has been opened and a textbox in the child has been edited. I don't want to open another window. If I "view source" in Internet Explorer, the contents of the .htm-file containing the table displayed in the IFRAME is not present eventhough I can see the table in the browser.

    How do I update the TEXTAREA in the ASP-file through clicking a row in the table displayed in the IFRAME, which is contained in another file, a .htm-file?

    Very thankful if you could help me solve this problem.
    /Lars

    P.S. The problem would be the same even if ASP wasn't involved. Just two .htm-files. D.S.

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Sweden
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    parent.form.mytextarea.value = parent.form.mytextarea.value+= "Jaha?";

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Sweden
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you get the row index?

    I can get the data of the first cell via this:
    Code:
    <script type="text/javascript">
    <!--
    onload=function() {
      row=document.getElementsByTagName('tr');
    for(c=0;c<row.length;c++){
      row[c].onclick=function(){
        if(this.getElementsByTagName('td')[0]!=null) {
           alert(this.getElementsByTagName('td')[0].firstChild.data);
        }
       }
      }
     }
    //-->
    </script>
    But I can not for the world seem to get the row-index. How do you do that?


Bookmarks

Posting Permissions

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