Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Passing value from iframe page to mainpage

Passing value from iframe page to mainpage

Scheduled Pinned Locked Moved Web Development
helptoolstutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    percyvimal
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • P percyvimal

      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

      A Offline
      A Offline
      Andrew Quinn AUS
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups