dsl36367 2010-12-01 05:00
浏览 33

如何获取左框架上的信息并更新右框架内的文本字段?

I need some help with frames. So basically, here's my dilemma ... I have created an index page that is broken down into 2 frames.

  • The left frame, basically has a tree of a directory that a user can select files from
  • The right frame, is my main content page. It has a text-field. Let's call it "file-path"

What I would like to do is that when the user clicks a specific file on the left frame, I want to grab that information and put it on the right-frame within the text-field.

I hope this makes sense, if not , I can go ahead and post some more information? It's not as simple that I want to open the file into the right-frame, I know I could do this by:

<a href="file.jpg" target="rightFrame">

... But not sure how to specifically target the text-box?

Cheers!

EDIT

I'm now using a form for the element:

echo" ";

However, I want the text to not be a button, I'd rather have it as text itself. Can someone suggest something? I can't do:

  1. Button
  2. Text ... it makes a text-field
  3. Hidden ... I can't see the text-field
  • 写回答

1条回答 默认 最新

  • dousao6313 2010-12-01 08:37
    关注

    add a handler (not sure about this.text)

    onClick="parent.rightFrame.set_field(this.text)"
    

    and in the right frame:

    function set_field(s) { 
        $("#field").text(s);
        return false;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?