Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  How do I pass a variable to the Add form please?

phpMyEdit General     How do I pass a variable to the Add form please?
Post new topic   Reply to topic    
 
rumex     Joined: 27 Oct 2017   Posts: 7  
Post 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  
Post 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    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy