Forum Moderators: open

Message Too Old, No Replies

Pulling Variable From IFrame

         

theriddla1019

1:36 pm on Aug 2, 2004 (gmt 0)

10+ Year Member



Ive been doing some research and im wondering if Include/Require would do the trick...tried it a little bit but it doesnt seem to work. I have a parent page then depending on user selection 1 to 3 different pages will load in IFrame's with dynamic content. Im wondering the best method to save the information in the iframes when the parent page is submitted to the database. Help!
Here is some exerts of my code:

Php function being called onclick for the submit button.
<?
function includeMe()
{
include 'freq.php';
}
?>

Submit Button

<input type="submit" value="Add Verbal Order" onclick="includeMe()">

Javascript Changing Iframe Values...

<script language="Javascript">

function AlterAction(value, id){
document.all.votypeframe.src=value + ".php?epid=" + id;
}

</script>

not sure if more information is needed ... anyone got any ideas?

Thanks!
Adam

httpwebwitch

4:12 am on Aug 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



onclick is a javascript event. PHP will be of no use in this situation. (wrong forum)

name your windows and iframes, use javascript to send hidden values betwixt them, and use the "onsubmit" event. with some effort, a form and submit button on a parent page can also submit mirrored data found in an iframe.

good luck

theriddla1019

7:09 pm on Aug 5, 2004 (gmt 0)

10+ Year Member



in all actuality its not the wrong forum persay, php values can be inputed to javascript just not the other way around. but incase anyone else runs across this situation this is how i did the workaround. i had javascript force submit the child page which action=child_page_add.php which added the values of the child page to the mysql database, on the child add page at the end I, $lastID = MYSQL_INSERT_ID();
which pulls the primary key of the last updated field and then on submitted the parent page using update where (primary key)=$lastID. My only? using this method is, is MYSQL_INSERT_ID() a race function? in the very minimal chance that it could happen could id's become crossed if two people added a record at the exact same time?
Thanks
Adam