Closed Thread Icon

Preserved Topic: target a form field in another frame? Pages that link to <a href="https://ozoneasylum.com/backlink?for=18065" title="Pages that link to Preserved Topic: target a form field in another frame?" rel="nofollow" >Preserved Topic: target a form field in another frame?\

 
Author Thread
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 05-29-2001 19:14

I have a page that creates two frames - "show" and "control". From the page that calls the frames, I have a function like this:
self.show.location.href = "show.html"; - this just loads show.html into the "show" frame. All works fine.

I'm trying to write a value, "sec" to a form field "clock" in the form "frm" in the "control", but I can't seem to get it to work. I've tried
document.frm.clock.value = sec,
control.frm.clock.value = sec,
self.control.frm.clock.value = sec

None of these seem to work. What am I missing here? document.frm.clock.value = sec works fine if the form field is in the same document as the script.


Pat Richard
A pixel is worth a thousand words.
http://www.gurusnetwork.com
ICQ 23113317

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 05-29-2001 19:19

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-29-2001 20:10

Pugz,

Are you trying to do this from the main frameset page?
Well here's the way I see it,

you know it should go:
frm.clock.value

and you know it should be
document.frm.clock.value
if the script is in the same frame

Then since you are one step up you just need to refer to the correct frame
control.document.frm.clock.value

See what I'm saying?

I've recently had to play with these alot. I had to write a script so that if someone clicked a link in a frame in a popup, the main parent window changed. that was (top.window.opener.location.href I believe)

Anyway I hate frames the reference gets ugly.




Walking the Earth like Kane

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 05-29-2001 20:23

Hmm....I'm still getting errors for both suggestions.

A test page is at http://www.macombsheriff.com/development/swat_training/swat.html, but you need to look at it at 1024x768 or higher, or you can't see the buttons. You'll see what I mean.

What I'm trying to do is paste "sec" into the form field on the far right (next to the "auto" button). What this is is a timer display. If you click on AUTO, it starts cycling through the pictures at 10 second intervals. I want to display the countdown in the form field. The buttons and stuff will be cleaned up later, but you should get the idea. The pictures and description are in the "show" frame, and the buttons and form field are in the "control" frame.

Any help would be great. If I pull out the command to display the countdown, the AUTO function works fine.

Pat Richard
A pixel is worth a thousand words.
http://www.gurusnetwork.com
ICQ 23113317

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 05-29-2001 20:32

Nevermind - I got it to work. Seems I somehow had a nested form! Duh!

Thanks to all who offered help.

Pat Richard
A pixel is worth a thousand words.
http://www.gurusnetwork.com
ICQ 23113317

« BackwardsOnwards »

Show Forum Drop Down Menu