Jump to content


Photo

how to retrieving data from an Iframe and pass to php


  • Please log in to reply
1 reply to this topic

#1 crouchjay

crouchjay
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 14 May 2006 - 01:23 PM

I am trying to retrieve a value from an I frame

var found = window.frames[course].forms[frm1].elements[golfcourse];

and then when the user presses the submit button send the variable found with the other data chosen.

So basically what is happening is; I am using an Iframe to search for courses then when the user has found a course it appears in an input text field. After the user chooses the course then the proceed to the main page and finsh filling out the form. The other fields I want submitted along with the course. How do I go about doing this? Thanks in advance.

Jay

#2 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 26 May 2006 - 05:51 PM

In your iframe, use the parent.Your_function_name() to call a javascript function in the main page. So, you'll need to create a function that will set the value of a hidden field in the main page. When the user search in the iframe and select the course, use the event (onclick, onchange, etc...) to call the parent function like this onclick="parent.Your_function_name('value');"

NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users