|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi folks..
ok i have a popup window which i have created in which there is a code i wish to send to a form within a frameset if that make sense. <a href="javascript arent.frames[2].setSmiley1(':-)')">this is the code im using which works fine when embeded within one of the frames within the frameset but it cant seem to work when it is issued from a popup window. Obviously it is an issue to do with locating the frame[2]? Please can anyone advise? |
|
#2
|
||||
|
||||
|
i have a few examples that may work, im not sure though, not tested...
from pop-up window do this.... opener.frame[2].formname.inputname.value=newvalueyouwanttopassin; or try... opener.getElementByID('frame[2]').formname.inputname... try the above and please post back if this has helped. colton22 |
|
#3
|
|||
|
|||
|
Hi..
thanx for the reply.. This is the code which is placed within a cgi file: } var clicks = 1 function setSmiley1(s) { document.send.message.value += s + '' } So when the link is clicked it should send the info to the form named send and the input field message. it works great when embbeded within a page located in one of the frames, but when in a popup it returns a null object error message. I tried your idea but it didnt seem to work either.. thanx |
|
#4
|
||||
|
||||
|
well why are you accessing this form by just document? is this on the main page?
please post your file or code |
|
#5
|
|||
|
|||
|
Normally this feature is placed within the frames which when clicked it works, thats the code for it to work when in the frames.
I'm trying to get this code to work from a popup window instead of it being embedded within the frames. I know this sounds confusing, but it's got me a bit baffled as to how to get it to post to the form within frame[2] from a popup window. Quote:
|
|
#6
|
||||
|
||||
|
suppose the frame page's name that contains the form named "send" with the input named "message" was named "frame[2]" (idk if it is)
if the function setSmiley1(s), is in that pop-up page, access it from the form input box in the frame[2] by using the following in your pop-up window... function setSmiley1(s) { opener.frame[2].document.send.message+=s; } now this will ONLY work if that page consealing frame[2] is the page that opened the pop-up, if it is not the "opener" (hint the opener. code above), there is not relationship with the page because of a javascript "rule". hope this helped colton22 |
|
#7
|
|||
|
|||
|
hi thanx for the help..
will try that right away.. Is it possible to just have a popup open from any page and it locate the form, input named message in the frames[2]? I created this about a year ago and it was fully working, but caqn i hell remember what i did to do this. Any ideas? I simply used the script i posted first off, but theres some thing im missing. cheers |
|
#8
|
|||
|
|||
|
hi thanx for the help..
will try that right away.. Is it possible to just have a popup open from any page and it locate the form, input named message in the frames[2]? I created this about a year ago and it was fully working, but caqn i hell remember what i did to do this. Any ideas? I simply used the script i posted first off, but theres some thing im missing. cheers |
|
#9
|
||||
|
||||
|
actually without having reference between the windows, meaning, opener, top, parent, exc., it is a "safely law" in javascript so they cannot access, if you wanted to do this you could do the following, but it would be harder and take a whole different code.
if you want to access a string/numeric data with ANY window temporarily, you could store the string/numeric data within a cookie, and name it accordingly, make sure secure=false therefore you could access it from anywhere, the only problem with this is that you are guessing that the user is on one machine, remote or user based. please post back w/ response. i will be back on tomorrow, it is 8:45pm here so yea, colton22 |
|
#10
|
|||
|
|||
|
It's ok i got it in the end.
The variable i was looking for was opener.parent Works a treat. Cheers for the ideas.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Targeting form from popup window to frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|