This topic is locked
[SOLVED]

 Linking to table_add.php as popup

1/30/2008 8:18:33 PM
PHPRunner General questions
M
marke author

Hi
I am using this link on the masterpage to popup the add form in a window
[codebox]<A id=master_tblpayments{$row.1recno} onclick="window.open('tblpayments_add.php?{$row.1tblpayments_masterkeys}','mywindow','width=400,height=550,toolbar=no,location=no,directories=no,status=no,menubar

=no,scrollbars=yes,copyhistory=yes,resizable=no,screenX=500,screenY=200')" href="#" >add payment </A>[/codebox]
Problem is that the masterkey passed to the add form tends to be the id for the last record that I clicked in the list page
Any ideas - I am stumped
My project is already up on the demo account - 'Renewals' or 'New Renewals'
Mark

J
Jane 1/31/2008

Mark,
I'm not sure that I understand you correctly.

What do you want to pass to the details add page?

M
marke author 1/31/2008

Jane
I need to pass the id of the person making the payment across to the payment form and then insert it into a field as a $_SESSION variable. I am getting an id to go across to the form - but its often not the correct person record id.
Here is what I want to happen.
starting point is two tables master-detail (tblpeople -> tblpayments)
1 - user goes to list page for tblpeople where they can inline edit some fields in a table with member information

2 - user can also click a link on the row for each member in the list table to add a payment (using the code snippet above)

3 - the add payment form pops up as a separate small window leaving the list displayed below the popup.

4 - when user clicks save on the add payment form the popup disappears
I have most of this working - except that the payment does not get associated with the member. It does link to one of the member records in the current list view - but not always the right one. I have done some investigation and the problem seems to be setting the context to the correct record. For example if I include the ajax popup on another link on each row - and always do the mouseover so that the link is displayed and then select the add payments link it works fine.
I think the problem is that the href="#" rather than href="tbl_payments_add.php?{row.1tblpayments_masterkeys} - but when I make this change the payments_add.php screen is displayed (replacing the list page) as well as the popup form. I think I need a way to set the {row.1tblpayments_masterkeys} for the correct row before I click the add_payments link. Is there an event or some property of the event that I could use.
thanks for your help
Mark
[BTW - thanks for the fix on not displaying the menu screen - now works fine]

J
Jane 2/1/2008

Mark,
I've tested your application on the Demo Account and added three records to the tblpayments table using your "add payment" link. All records are added with correct foreign key.

Could you send me instructions on how to reproduce this issue on the Demo Account server?