would like the submit button to reload both pages

<div><input type='button' onclick='self.location.reload(true)' value='ReloadSelf' /></div>
reloads date.php


<div><input type='button' onclick='top.location.reload(true)' value='ReloadTop' /></div>
reloads both date.php and iframe.php


would like the submit button to reload both pages
date.php
<?php
require_once('../common.php');
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
echo '<br><br>';

if (isset($_POST['date1']))
{
    $variable1 = $_POST['date1'];
    $variable2 = $_POST['date2'];

    $_SESSION['date1'] = $_POST['date1'];
    $_SESSION['date2'] = $_POST['date2'];
    
   //to print them:
   echo $variable1;
   echo $variable2;
}
?>

<form name="chooseDateForm" id="chooseDateForm" action="#" method="post">
       <fieldset>
          <div><input type='button' onclick='self.location.reload(true)' value='ReloadSelf' /></div>
          <div><input type='button' onclick='top.location.reload(true)' value='ReloadTop' /></div>
         <legend>Test date picker form</legend>

                   <ol>
                       <li>
                           <label for="date1">Date 1:</label>
             <input name="date1" id="date1" class="date-pick" />
           </li>
                       <li>
                           <label for="date2">Date 2:</label>
             <input name="date2" id="date2" class="date-pick" />

           </li>
           
           <li>          
           <input type="submit" value="Send"> 
           </li>
         
           
           
         </ol>
       </fieldset>
     </form>




--------------------------------------------------------
iframe.php
<?php
require_once('../common.php');
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
echo '<br><br>';

echo'<iframe src="date.php" width="80%" height="510"> </iframe> ';



  
?>

Open in new window

LVL 1
rgb192Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
try:
<form target='_top' name="chooseDateForm" id="chooseDateForm" action="#" method="post">
0
rgb192Author Commented:
changing line 24 refreshes self only
<form target='_top' name="chooseDateForm" id="chooseDateForm" action="#" method="post">

changed line 42 to the following (with and without the line 24 change)  and only self is refreshed

 <input type="submit" value="Send" onclick='self.location.reload(true)' onclick='top.location.reload(true)'>

 <input type="submit" value="Send" onclick='self.location.reload(true)'>
 <input type="submit" value="Send" onclick='top.location.reload(true)'>
0
hieloCommented:
don't put any onclick on the send button. It should be simply:

<input type="submit" value="Send">

but the form needs
target="_top"
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

rgb192Author Commented:
line 24 <form target="_top" name="chooseDateForm" id="chooseDateForm" action="#" method="post">


line 42 <input type="submit" value="Send">


refreshes top
but requires an extra submit button push.

So I have to click submit button 2x to get the top to refresh correctly
0
hieloCommented:
>>refreshes top
>>but requires an extra submit button push.
You are not making sense. It the top window refreshes then it will reload the contents of the frame as well.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgb192Author Commented:
thanks

i had to put the
print session in the condition
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.