Index
» Projects
» phpMyEdit
» Forum
» How do I pass a variable to the Add form please? |
|
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);
}
|
yousuf
Joined: 16 Sep 2021
Posts: 92
Posted: 2021-11-14 11:04
Back to top
Reply with quote
|
heya. I notice that you’re most likely interested in building back-links and stuff. I’m promoting scrapebox auto approve link lists. If you’d like to trade ?
best place to buy instagram followers
|
danverseak2
Joined: 07 Sep 2022
Posts: 62
Posted: 2022-09-07 10:20
Back to top
Reply with quote
|
Our fencing professionals can provide the help that you need and at the same time answer inquiries that you may have in mind but afraid to ask.
Fence Company of Roseville
|
Post new topic
Reply to topic
|
|
|
|