hmm.. it'll get real ugly with javascript,but this works with newer
browsers.
...iframe has a name
...main page has a hidden form field with id   checkbox in the iframe has id
also

iframe.php
<html>
<head>
<script>
 function submit_form(){

 if(frames["myiframe"].document.getElementById("one").checked == true){//see
if the checkbox in iframe is checked
    // if it is checked assign it's value to the hidden field in this page
        document.getElementById("one_copy").value =
frames["myiframe"].document.getElementById("one").value;
    }
  document.form1.submit();
    }
</script>
</head>

<body>
<?php
if($_POST['test1']){
echo $_POST['test1'] . '<br />' . $_POST['one_copy'];
}
?>
 <form name="form1" action="iframe.php" method="post">
 <input type="text" name="test1"><br>

 <iframe name ="myiframe" src = iframetest.htm></iframe><br>
 <input type="hidden" id="one_copy" name="one_copy" value="">
 <input type="button" value="sub" onclick="submit_form()">
 </form>
</body>
</html>


iframetest.htm
<html>
<body>
 <form>
 <input type="checkbox" id="one" name="one" value="hello">
 </form>
</body>
</html>



----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Greg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 5:31 PM
Subject: RE: [PHP] IFRAMES & PHP


> > Unfortunatly, that gets rid of the reason I have the iframe in there
> to
> > begin with.  I need a scrollable iframe with a set of buttons that
> perform
> > certain actions at the top, that have to always be at the top.
> > -Greg
>
> Then put the entire <form> into the iframe.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to