thanks for the information but I can not make it work
I'll explain what I must do
I have a table with the names of customers and a Boolean field that identifies customers active or inactive
now in the form I added 2 drop down
the first I need to select whether the account is active or inactive (Field Name: tipologia)
the second would I load a list of customers based on the choice I made in the first (Field Name: cliente)
in the sections on load I added a custom code to retrieve customer names
<?php
$db =& JFactory::getDBO();
$query_lista_clienti_a = "SELECT distinct(cliente) FROM sks_app_clienti WHERE abilitato=1";
$db->setQuery($query_lista_clienti_a);
$form->data['listaCDA'] = $db->loadAssocList();
$query_lista_clienti_na = "SELECT distinct(cliente) FROM sks_app_clienti WHERE abilitato=0";
$db->setQuery($query_lista_clienti_na);
$form->data['listaCDNA'] = $db->loadAssocList();
?>
right after I inserted an element Dynamic Dropdown
in Dynamic Dropdown I have set
Use AJAX? : Yes
AJAX Event name: cliente
Extra options extension:
<?php
$tipologia = $form->data['tipologia'];
$results = array();
$results[] = '=??';
if($tipologia == 1)
{
foreach ($form->data['listaCDA'] as $value)
{
$results[] = $value.'='.$value;
}
$results = implode("\n", $results);
echo $results;
$mainframe =& JFactory::getApplication();
$mainframe->close();
}
else
{
foreach ($form->data['listaCDNA'] as $value)
{
$results[] = $value.'='.$value;
}
$results = implode("\n", $results);
echo $results;
$mainframe =& JFactory::getApplication();
$mainframe->close();
}
?>
the error is definitely in the use of drop down and the Dynamic Dropdown that I did not understand.
can you help me?
thanks