Hi all, im working on an order form that I have a pop-up box to select a client to associate with the order. Ive got this nearly working so that the user clicks on a button and the pop-up comes up and they click on the client, which is then stored in a session variable and the pop-up closes.
What i want it to do is then display that clients data in the parent form, ie name company phone. I can do this if i get the pop-up to refresh the parent, but i have the parent reloading itself to check for errors and to submit - so it either submits straight away or displays an error for not completing the form.
I can also do this using a text field and using blur, but this looks untidy. So is there a way that i can use a table and the parent will update it when the pop-up closes? Ideally i would have variables in the table, that javascript can update, but dont know if this is possible.
This is the code im using in my popup at the moment-
<form>
<input type="submit" name="submit" value="Select Client">
</form>
<?
if (isset($GET['submit'])) {
$SESSION['order']['clientID'] = 1;
?>
<script language="JavaScript" type="text/javascript">
<!--
window.opener.location.reload();
window.close();
//-->
</script>
So when the parent refreshes, it detects the client id, and displays the clients info in the order form. (but comes up with the page is trying to refresh itself messgae). Would it be possible for the pop-up to call a fucntion in the parent - like update_client_info
Hope this makes sense
😕