开发者

How to take information on a left frame and update a text-field within the right frame?

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"
开发者_Python百科

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


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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜