互动互动<选择>

Thank you very much for your clear and fast answer.

Maybe I have to precise: it's in a wordpress website. The part with the FIRST select is in a PHP CODE WIDGET and the second select is in the subtag.php page i have uploaded in the website!

On my page I inserted it (it's write in French sometimes):

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#constructeur_moto_id").change(function(){
        $("#subcat").load("subtag.php?name="+$("#constructeur_moto_id").val());
    });
});
</script>
Constructeur Moto
<select name="constructeur_moto_id" id="constructeur_moto_id">
<?php
//Select Moto Brand
$constructeur = 'SELECT constructeur_moto_id,constructeur_moto_nom FROM a_constructeur_moto ORDER BY constructeur_moto_nom';
$constructeur_query = mysql_query($constructeur) or die( 'Erreur' );
    echo '<option>Constructeur Moto</option>';
    while ( $constructeur_list = mysql_fetch_array( $constructeur_query ) ) {
        echo '<option value="'.$constructeur_list['constructeur_moto_id'].'">'.$constructeur_list['constructeur_moto_nom'].'</option>';
}
?>
</select>
<div id="subcat"></div>

The list of moto brand (constructeur_moto) appears like I want on my page.

Here is my subtag.php page:

<?php if(isset($_REQUEST['name']))
{ 
echo $_REQUEST['name'];
?>
Modele Moto
<select name="modele_moto_nom">
<?php
//Select Modele moto
$modele = 'SELECT modele_moto_id,modele_moto_nom,modele_moto_annee,modele_constructeur_moto_id FROM a_modele_moto WHERE  modele_constructeur_moto_id='.$_REQUEST['name'].' ORDER BY modele_moto_nom';
$modele_query = mysql_query($modele) or die( 'Erreur' );
    echo '<option>Modèle Moto</option>';
    while ( $modele_list = mysql_fetch_array( $modele_query ) ) {
        echo '<option value="'.$modele_list['modele_moto_id'].'">'.$modele_list['modele_moto_nom'].'</option>';
}
?>
</select>
<?php } ?>

When I choose a moto brand, the subtag.php page is loaded (I echo the moto brand ID to check this (line 3)), the < select > form appears but nothing is loaded in it. I really don't undestand!

i have created solution for you.. first you need to include jquery on your page

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

after placing this script on your page you have to write jquery which will pass the data for your sub tag which is

<script>
$(document).ready(function(){
    $("#moto_brand_nom").change(function(){
        $("#subcat").load("subtag.php?name="+$("#moto_brand_nom").val());
    });
});
</script>

after placing the script you need to write your <select> tag with passing id as i have done.

<select name="moto_brand_nom" id="moto_brand_nom">
<?php
//Select Moto Brand
$constructeur = 'SELECT moto_brand_id,moto_brand_name FROM a_constructeur_moto ORDER BY moto_brand_name';
$constructeur_query = mysql_query($constructeur) or die( 'Erreur' );
    echo '<option>Moto Brand</option>';
    while ( $constructeur_list = mysql_fetch_array( $constructeur_query ) ) {
        echo '<option value="'.$constructeur_list['moto_brand_id'].'">'.$constructeur_list['moto_brand_name'].'</option>';
}
?>
</select>

then you have to write just a <div> tag with passing its id

 <div id="subcat"></div>

after this process you have to create one another page called subtag.php and place the code of below on the page.

<?php if(isset($_REQUEST['name']))
{ ?>
<select name="model_moto_name">
<?php
//Select Model moto
$model = 'SELECT model_moto_id,model_moto_name,model_moto_annee,constructeur_moto_name FROM a_model_moto WHERE  moto_brand_id='.$_REQUEST['name'].' ORDER BY model_moto_name';
$model_query = mysql_query($model) or die( 'Erreur' );
    echo '<option>model Moto</option>';
    while ( $model_list = mysql_fetch_array( $query ) ) {
        echo '<option value="'.$model_list['model_moto_id'].'">'.$model_list['model_moto_name'].'</option>';
}
?>
</select>
<?php } ?>

i hope this code will work for you