rumex
Joined: 27 Oct 2017
Posts: 7
Posted: 2018-05-09 14:02
Back to top
Reply with quote
|
Hi
When I open my form (in list view), in the php I have
$agentId=$_GET["agentId"];
I want to click a button. 'Add' and be able to use the contents of $agentId to fill a field in by default.
How do I pass a value to the Add form please?
|
rumex
Joined: 27 Oct 2017
Posts: 7
Posted: 2018-05-09 15:34
Back to top
Reply with quote
|
Typically I found the answer just after I had given up finding one...
$opts['cgi']['persist']['agencypid'] = $agencyId;
$agencypid = $_POST["agencyid"];
$opts['fdd']['AgencyId'] = array(
'name' => 'Agency',
// *** The lookup and the display are different here.
'sql|LFV' => 'if(AgencyId > "0", CONCAT("<a href=\"otherPage.php?agencyID=", AgencyId, "\" target=\"_blank\"", " title=\"", AgencyId ,"\"", ">AgencyId</a>"), "")',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);
if ($agencyPersistedId == "")
{
// nothing persisted
$opts['fdd']['AgencyId']['values'] = array('table' => 'agency', 'column' => 'id', 'description' => 'name');
}
else
{
// filter on persisted ID
$opts['fdd']['AgencyId']['values'] = array('table' => 'agency', 'column' => 'id', 'description' => 'name', filters => 'id = ' . $agencyPersistedId);
}
|
|
Post new topic
Reply to topic
|
|
|