Passing value from iframe page to mainpage
-
I have a 2 pages 1. Main page (which contains the iframe) (MainPage) 2. A page Within IFrame (Sub Page) Now i have list of records in sub Page and have a link for each records. when a user click that link using that link i need to send a value(values of that record selected) to the mainpage. only way of doing is i have to reload the main page. I was able to load the main page by using the script parent.location.reload(); but problem i have is i can load the main page from the Subpage but how to pass value from sub page to main page. Say i have values Code = 95 Type= A Localvalueofthatpaage="ALexander" I have these values in Sub Page and have to pass to main page I need help very urgently thanks in advance with regards vimal Help in need is the help indeed
-
I have a 2 pages 1. Main page (which contains the iframe) (MainPage) 2. A page Within IFrame (Sub Page) Now i have list of records in sub Page and have a link for each records. when a user click that link using that link i need to send a value(values of that record selected) to the mainpage. only way of doing is i have to reload the main page. I was able to load the main page by using the script parent.location.reload(); but problem i have is i can load the main page from the Subpage but how to pass value from sub page to main page. Say i have values Code = 95 Type= A Localvalueofthatpaage="ALexander" I have these values in Sub Page and have to pass to main page I need help very urgently thanks in advance with regards vimal Help in need is the help indeed
Hi there, Create a jscript/vbscript function in your main page, then in your sub page you can call the function passing whatever you need, eg. Function in sub page
<!--
function update(value)
{
var wndControlPage = parent;
// test the parent page exists, and test there is a function
// defined with this name on the page...
if (wndControlPage && wndControlPage.MyFunction}
{
// success, lets call it
wndControlPage.MyFunction(value);
}
else
{
// error...
}
}
//-->Hope this helps, Andy