Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Štvrtok, 26. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  How do I pass a variable to the Add form please?

phpMyEdit General     How do I pass a variable to the Add form please?
Odoslať novú tému   Odpovedať na tému    
 
rumex     Založený: 27.10.2017   Príspevky: 7  
Príspevok Zaslal: 2018-05-09 14:02
Návrat hore  Odpovedať s citátom     

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     Založený: 27.10.2017   Príspevky: 7  
Príspevok Zaslal: 2018-05-09 15:34
Návrat hore  Odpovedať s citátom     

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);
}

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov