How to get data from another frame ?

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

How to get data from another frame ?

Post by David de Argentina »

Hi all,

I'm doing a program in order to manipulate a mysql database.
As server does not allow remote connection with the database, i need do this program using php / javascript

Program has two frames: Top frame has the process buttons ( New, Delete, Modify, Refresh, etc) and Main frame has the data.

Figure 1:

Image

Main Frame table has a radio button controls, in order to determine what record i want to process.

Using this javascript i can get the real ID of the row of the table:

Code: Select all

for (var x = 0; x < 15; x++) { if (document.getElementsByName('cual')[x].checked) { alert('id = ' + document.getElementsByName('cual') [x].value);}}
This javascript works fine, when i run the Main Frame as separate instance, or another browser window.

As the buttons of the program are in the top frame, i can't get the window.frames.mainFrame.document.etc values, based on a security reasons.

Are there any way to connect actions within top frame with data at mainFrame ?

Any ideas ?

Thanks in advance,
David de Argentina
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: How to get data from another frame ?

Post by David de Argentina »

This line of code does de job:

[syntax=javascript]window.parent.frames[1].document.getElementsByName('cual')[x].checked)[/syntax]

greetings from Buenos Aires,
David de Argentina
Locked