Source language: Translate to:

How to get data from another frame ?

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

How to get data from another frame ?

Postby David de Argentina » Mon Aug 31, 2015 10:45 am

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
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: How to get data from another frame ?

Postby David de Argentina » Mon Aug 31, 2015 3:06 pm

This line of code does de job:

Syntax: [ Download ] [ Hide ]
Using Javascript Syntax Highlighting
window.parent.frames[1].document.getElementsByName('cual')[x].checked)
Parsed in 0.003 seconds, using GeSHi 1.0.8.10


greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

cron