Bienvenido, Invitado
Recordarme

TEMA:

problem showing a select item populated with the database 8 meses 1 semana antes #271697

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3262
  • Karma: 2
  • Gracias recibidas: 160
Hi,

you can send it on my email, ma@evolutio.hr


if you have more questions, feel free to ask!

Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

problem showing a select item populated with the database 8 meses 1 semana antes #271704

  • Autor del tema
  • Sherco
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 34
  • Gracias recibidas: 2
OK, package sent on you email
thank you

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

problem showing a select item populated with the database 8 meses 1 semana antes #271706

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3262
  • Karma: 2
  • Gracias recibidas: 160
Hi,

oke, I have one question!

Do you want populated one select list, based on the selected value in another select list?

Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

problem showing a select item populated with the database 8 meses 1 semana antes #271717

  • Autor del tema
  • Sherco
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 34
  • Gracias recibidas: 2
Yes , i want to populate the "#ff_elem410" list with the result of the "sidefab" list'choice (#ff_elem397).
The ajax query send back a correct string: for example, chhosing "Héchard" fills the ajax query result with : "Saphir","1","10"],["Serval","2","10"],["Sygma","3","10"],["Swan","4","10"
the first index is the model name, the second is the model index, and the third is the maker index (wich i doesn't use here)
I want to populate the list with the model index as the value and the model name as the text
the problem seems to occur in the way the code fills the list entries, even the first hard coded list entry ( "choisir une option" is not showed in the result

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

problem showing a select item populated with the database 8 meses 1 semana antes #271719

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 3262
  • Karma: 2
  • Gracias recibidas: 160
Hi,

can you please provide here code, where your research the database?

Scenario:

Select list 1
Select list 2

Depending on the selected value of 'select list 1', we research the database, and the result of the research of the database, we store in another 'select list 2' ?

If this oke for you, and if you wanted this, I can create an example of how to do it, and based on my example you can embed code into your FORM.

If this oke for you, please let me know!

Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

problem showing a select item populated with the database 8 meses 1 semana antes #271720

  • Autor del tema
  • Sherco
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 34
  • Gracias recibidas: 2

Mirec escribió: Hi,

can you please provide here code, where your research the database?

Scenario:

Select list 1 : the select code is in the "before form section of the "more options" in the form's "advanced" tab
//


remplit la liste des fabricants de sidecar avec celle déjà présentes dans la table "K1_side_fab" de la base de données
$db = JFactory::getDBO();//Get Database Object
$db->setQuery('Select sidefab_nom , sidefab_id From #__side_fab ORDER BY sidefab_id DESC ');
$result = $db->loadRowList(); //load the result from the query[/color]


Select list 2: php code to query the database:

<?php

define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';


$db = JFactory::getDBO();

$code=$_POST; // the value posted from the AJAX request above

$db = JFactory::getDBO();
$query="Select sidemodel_nom,sidemodel_id,sidefab_id From K1_side_modeles Where sidefab_id = '$code' ";
$db->setQuery($query);
$result=$db->loadRowList();

if(!$result){
echo "empty";
}
else
{
echo json_encode($result);
}

?>


Depending on the selected value of 'select list 1', we research the database, and the result of the research of the database, we store in another 'select list 2' ? YES

If this oke for you, and if you wanted this, I can create an example of how to do it, and based on my example you can embed code into your FORM. YES Thank you

If this oke for you, please let me know!

Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Tiempo de carga de la página: 0.104 segundos