Forum Moderators: coopster
I've got a wee problem I'm having difficulty with. What I have is a form whereby when you click on this button a pop-up calendar appears.
What I'm trying to achieve is that when you do click on a date it closes the window and then refreshes the parent window and displays the date selected. The code below is what I have, but this doesn't work.
Any ideas?
Cheers. :o)
Code:
<table>
<form name="myform" method="post" action="callback_date.php" target="mypopup" onsubmit='window.open("",this.target,"scrollbars=yes,width=650,height=580");return true;' >
<tr>
<td class="labelcell">Salesman</td>
<td>Sales</td>
<td><input type="submit" name="status" value="Callback date" class="button"></td>
<td class="labelcell"><!-- This is where it should populate the date selected -->
<? echo $callbkdate?></td>
</tr>
<input type="hidden" name="bwid" value=<? echo $bwid;?>>
<input type="hidden" name="source" value=<? echo $source;?>>
</form>
</table>
callback_date.php
This is a snippet of the code:
echo "<td><a href=main-sales.php?bwid=$bwid&callbkdate=$link_date&source=$source onclick=\"window.opener.location.reload();self.close();return false;\"> $day </a></td>";
As you can see I'm using javascript, but I'm hoping to pass the variable callbkdate so that it should populate, but it ain't.
Thanks.
This is the code, I've used:
echo "<td><a href=main-sales.php?bwid=$bwid&callbkdate=$link_date&source=$source onclick=\"window.opener.location.href.reload();self.close();return false;\"> $day </a></td>";
This works in the child window, and populates the date, but it doesn't close the window and refresh the parent, so nearly there with it.
Thanks